-
(1) How can I pass a parameter value from the shell environemnt to the SQL*Plus environment ?
(2) Also, how can I send the output from sqlplus to a log file when it is run from with a shell script ?
Basically this is what I want to be able to do, but when I do this, the control goes to the log file, and I cannot see what I am typing:
within a schell script
...
...
sqlplus scott/tiger@db1 @sqlSCRIPT.sql > sqlLOG.log
...
...
-
Originally posted by khussain
(1) How can I pass a parameter value from the shell environemnt to the SQL*Plus environment ?
Pass it as a positional parameter on the command line. For example:
Code:
sqlplus scott/tiger@db1 @myscript $ENV_PARAM1 $ENV_PARAM2 $ENV_PARAMn
In your script, your substitution variables will be &1 for the first argument, &2 for the second, etc.
(2) Also, how can I send the output from sqlplus to a log file when it is run from with a shell script ?
Basically this is what I want to be able to do, but when I do this, the control goes to the log file, and I cannot see what I am typing:
within a schell script
...
...
sqlplus scott/tiger@db1 @sqlSCRIPT.sql > sqlLOG.log
...
...
Send it to standard out and allow your shell script to handle it. I typically use :
Code:
#!/bin/ksh
exec > /tmp/mylogfile.$$
sqlplus scott/tiger@db1 @myscript.sql
Jeff Hunter
-
I still want the output to the screen also - how would that be done ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|