oracle - Remove query from spool output in SQL Developer with variables -
I am trying to spool results directly into CSV using some replacement variables. I have this question:
set off the echo set response set off pagesize 0 set termout defined define StartDate = '12 -JAN-14 'defined ENDDATE = '01 -JUN-14' vpath =. C:; & Amp; \ 14-0724_Spool \ test \ 60_testupdate_subvar 'def def =' csv 'SPOOL & amp; dt = defined' vpath & amp; & Amp; DT & amp; & Amp; Select Ext / * csv * / table1.SOURCE_DMS_ID, COUNT (table1. AMOUNT) from table1 to table1.DATE TO_DATE (between '& amp; StartDate') and TO_DATE ('& amp; ENDDATE' ) - and Table 1_DIM.SOURCE_DMS_ID by table '01 -JAN -14 'and '31 -JAN-14' between table1_DATE; ... is being called with this script:
@ "\ Results_Feed_Spooled.sql" I specifically call it with a script (and set many other items) so that the resulting CSV file does not query the file. However, the selection query appears in the CSV file. The interesting thing is that when I change the actual date (see the comment section of the query) rather than the reference to the replacement variable, the query does not appear in the CSV.
Why does using the variable in the WHERE section instead of the actual values cause the query to be included in the result file? How can I fix this?
(SQL Developer Edition 4.0.0.13)
thanks
Assume that SQL_Developer is sqlplus compliant, first, try adding "SET VERIFY OFF". If that does not work, you can also try spool after query as the following example:
Verify the set x = 'x' Define 'double' Select * from & amp; X '=' x 'spool x.out / off spool after the selection of the blank line, and the lack of semi-colon after the SELECT statement.
Comments
Post a Comment