Link to home
Start Free TrialLog in
Avatar of jl66
jl66Flag for United States of America

asked on

dynamic query execution issue with a variable: in pl/sql procedure to create a directory

Want to create a directory in a PL/SQL procedure. If I don't consider the variable in the string to create the directory, it worked. However I have to consider the variable. For example,
declare
   v_str varchar2(6) := 'cat1';
begin
   v_sqltx := 'create or replace directory WK_DIR as ''c:\temp\''||v_str';
   execute immediate (v_sqltx );
end;
/
It did not work. Can any gurus offer some advice?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jl66

ASKER

Super! Greatly appreciate it.