Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01780: string literal required error

nkandwalNov 2 2015 — edited Nov 2 2015

I need to create a directory depending on the path  ( for example it will be /export/home/'camsdocd/meterwatch for development , /export/home/'camsdocq/meterwatch for QA and/export/home/'camsdocp/meterwatch for production

Here is what I thought but I am getting the error below

declare

v_camsdoc v$instance.instance_name%type;

v_stmt varchar2(1000);

begin

select instance_name

into v_camsdoc

from v$instance;

  v_stmt :=  'CREATE OR REPLACE DIRECTORY METERWATCH AS /export/home/'||v_camsdoc||'/meterwatch';

   execute immediate v_stmt;

end;

Error at line 1

ORA-01780: string literal required

ORA-06512: at line 9

This post has been answered by Solomon Yakobson on Nov 2 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2015
Added on Nov 2 2015
3 comments
2,596 views