plsql - execute immediate error when performing create directory command in pl sql -


execute immediate 'create or replace directory user_dir as' ||'"c:\proc"'; 

when execute code above, throwing following error:

error @ line 1:

ora-01780: string literal required

ora-06512: @ "databasename.writedata", line 7

ora-06512: @ line 1

use this:

declare  varchar2(100);  begin  a:= q'[create or replace directory g_vid_lib '/video/library/g_rated']'; execute immediate a;  end; 

this create directory on server oracle installed not on machine drive.

sql> select * dba_directories lower(directory_name) = 'g_vid_lib';  owner                directory_name          directory_path ------------------------------ ------------------------------       sys                  g_vid_lib              /video/library/g_rated 

in case goes like:

declare  varchar2(100);  begin  a:= q'[create or replace directory g_vid_lib 'c:\procedure']'; execute immediate a;  end; 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -