Updating nqs spool file
The script isspool &spool_fileselect Col1 from Table1 where Col3 = 'Y';spool off;exit; And it I would like to run assqlplus user/[email protected] @my_script 'e:\AHD Desc\logs\My_file.txt' August 29, 2003 - am UTC directories with spaces -- another great windoze innovation. in anycase, you cannot specify a spool name with a space in it in 9i.
even though you could do it on unix forever -- no one actually *did*. you'll have to use the mapped 8.3 dos filename instead. Thus...spool sql_test1.logselect to_char(sysdate, 'DD-MON-YYYY HH24: MI: SS') BEGIN_TIME from dual;set SHOW_OUTPUT_IN_SPOOL_FILE=FALSE-- I don't care about seeing the query RESULTSselect count(*) from dba_objects;set SHOW_OUTPUT_IN_SPOOL_FILE=TRUEselect to_char(sysdate, 'DD-MON-YYYY HH24: MI: SS') END_TIME from dual;spool off......... and then execute it.problem iam facing : when i spool i even get the above query with i am not able to execute the file .
Another option that might work for you would be to redirect sqlplus's output instead of spooling. /bin/kshsqlplus -s scott/tiger It would be a nice enhancement to be able to append to an existing spool file.
The workaround now is to have the OS redirect the output to a file instead of appending,and in the process do the appending...
All the best, spool uses buffered file io (eg: like the C fopen, fwrite, fread functions provide).
The OS buffers this information, typically in 8k chunks.
This is most inconvenient since there is a lot of sql scripts launched.
In the shell we start spooling the results in a file, then we start each sql script one by one, then we stop spooling just as follows :sqlplus -s USER/PASSWORD spool SPOOLFILE start script1start script2spool off STOPSince we work on a large database, several hours can pass between the beginning and the end of the korn shell.
If no one ever puts it into the system, it'll never have a chance of getting acted on except by sheer accident.
I saw the example you provided to spool to any filename; passed as a parameter.
You can use this to monitor your scripts in the database.
Justselect module, action, client_infofrom v$session where username = 'USER';to see this information.
If the users don’t get the email, or there is a problem with it, checking that the output was written to the spool (use transaction SP01 or SM37).