3 Useful SQL*Plus Tips

I stumbled on the following SQL*Plus tips at a new Oracle blog called Tahiti Views:

@ (”at” sign) vs. @@ (double “at” sign): With @@, all the import commands are processed relative to the directory where the original file sits, not the directory where you run SQL*Plus.

Splitting Up Package Code: You can split a big PL/SQL package script file into many smaller ones using the @ (”at” sign) SQL*Plus command. For example:

create or replace package foo
as
@foo_declarations;
@foo_procedures;
@foo_functions;
end;

Turn a File into a String Literal: Also using the @ command, you can turn the entire content of a file into a string literal. For example:

select
'
@foo.htm;
'
from dual;

You can also use the alternative quoting mechanism in case the file contains single quotes. For example:

select
q'{
@bar;
}'
from dual;

neat!


Possibly related:


Tagged | Post a Comment