This content has been marked as final. Show 2 replies
SJM wrote:Can you add the "SET DEFINE OFF" command to the beginning of file.sql?
We are receiving sql files (insert statements) from a third party, via an automatic process. I want to load these files using sql*plus but also want to SET DEFINE OFF to prevent variable substitution. We can't alter the sql files in any way. I'm using:
sqlplus user/pass@db @file.sql
Is there anyway I can set the parameter in the command line? I don't particularly want to use glogin.sql as other scripts I run will require DEFINE to be on. Thanks.
If you can't change file.sql, then create a script called define_off_and_run.sql, like this:
Then invoke sqlplus like this:
-- define_off_and_run.sql - turns off substitution variables, then runs &1.sql SET DEFINE OFF @&1
If you can't do any of the above, maybe you could use login.sql instead of glogin.sql.
sqlplus usernm/pass@db @define_off_and_run file.sql
Should this user always have SET DEFINE OFF? (E.g., is this user used only for this upload process, or can you create a user to be used only for this upload process?)
If so, you can make test to see who the user is in glogin.sql (or login.sql) and SET DEFINE OFF only if it's the special user.