Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Unix shell script drops chars sent to sqlplus - here document, etc.
CBarr wrote:
> Does anyone know why this would happen?
<snipped>
The problem I think is mixing and matching characters in attempt to make the complete script fit into the print commands double quotes.
Rather do this instead. Many times simpler and you do not require to enclose the embedded scipt's contents with quotes.
-- #!/bin/sh # variables spoolFile=$spoolDir/drillProdTemp.lst # run SQL script by redirecting STDIN sqlplus << EOF ${L_USER_NAME}/${pw} SET echo on; SET termout on; SPOOL ${spoolFile}; CREATE TABLE drill_prod_temp AS SELECT prod.surr, .. insert rest of your script here .. SPOOL off; EXIT; EOF -- If you want to supress all output from SQL*Plus, just wanting to have the spool file, you can replace this: sqlplus << EOF with this: sqlplus 1>/dev/null 2>/dev/null << EOF -- BillyReceived on Tue Mar 04 2003 - 09:17:24 CST
![]() |
![]() |