bind variable substitution in oracle sql string

379 Views Asked by At

I am trying to get the default dbf file location from a select statement and use this location to create tablespaces later on. I am having some trouble doing it in the sql script. I tried to use pl/sql and bind variables. Please let me know how i could fix this. Thanks

VARIABLE v_name VARCHAR2;
BEGIN
 select value into :v_name from v$parameter where name = 'db_create_file_dest';
END;
/

CREATE TABLESPACE cyyou_test DATAFILE  :v_name||'/test.dbf' SIZE 100M .....;
0

There are 0 best solutions below