Running dynamic scripts
DB: Oraclle 11g
I need to run sql scripts dynamically and build the following code in file script.sql:
OS: AIX 6.1
@define.sql
declare
i int;
linha char(5);
conexao char(50);
begin
for i in 1..&&QUANT_LINHAS loop
linha := substr('&&ORACLE_SID', 1, 3) || to_char(i);
conexao := '/cmdlib/oracle/connect/' || '&&ORACLE_SID' || '/connect_' || trim(linha) || '.sql';
end loop;
end;
/
In define.sql I have:
DEFINE ORACLE_SID = BRMB
DEFINE QUANT_LINHAS = 5
When I run the file script.sql get the following error:
SP2-0310: unable to open file "conexao.sql"
How can I fix this?
0