for ...loop in sql via text files
hi guys,
i need a kick start, how to i go about doing a for ...loop over a text files?
basically , i need to loop through a lost of db name then get the alert log of it. Doing this in .bat.
the .bat will ( echo exit | sqlplus -S xxxxxxxxxx/xxxxxxxx@%%A @test.sql)
-- test.sql look as below ... .
for (text files {
BEGIN
vInHandle := utl_file.fopen('Q_ALERT_LOG_<DB_NAME>_LOC', 'alert_<DB_NAME>.log', 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
dbms_output.put_line(vNewLine);
EXCEPTION
WHEN OTHERS THEN
EXIT;
END;
END LOOP;
i need a kick start, how to i go about doing a for ...loop over a text files?
basically , i need to loop through a lost of db name then get the alert log of it. Doing this in .bat.
the .bat will ( echo exit | sqlplus -S xxxxxxxxxx/xxxxxxxx@%%A @test.sql)
-- test.sql look as below ... .
for (text files {
BEGIN
vInHandle := utl_file.fopen('Q_ALERT_LOG_<DB_NAME>_LOC', 'alert_<DB_NAME>.log', 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
dbms_output.put_line(vNewLine);
EXCEPTION
WHEN OTHERS THEN
EXIT;
END;
END LOOP;
0