How to remove extra lines in the output file?
Posted: Tue Oct 03, 2006 1:42 am
I want to extract table from Oracle using DSExecute and sqlplus as below:
cmd = "sqlplus -s ":userID:"/":passWD:"@":dbName:" @":sFolder:"\eAccountBilling.sql ":extractDate:" > AccountBilling.txt"
Call DSExecute("NT",cmd,output,rc)
I use one parameter extractDate to pass to sql script file eAccountBilling.sql
In script file, I specify that parameter as &1. When this job runs, the value of the parameter I passed is: 2006-09-30
This job works fine, however, the output file contains the query result and 2 extra lines as:
old 1: select * from ACW.Package a where a.MIS_UPDATE_DATE between trunc(cast('&1' as date) -1) and trunc(cast('&1' as date) -1) + 0.99999
new 1: select * from ACW.Package a where a.MIS_UPDATE_DATE between trunc(cast('2006-09-30' as date) -1) and trunc(cast('2006-09-30' as date) -1) + 0.99999
... query result goes here
Could somebody tell me how to remove those 2 extra lines from the output file? Thank you!
cmd = "sqlplus -s ":userID:"/":passWD:"@":dbName:" @":sFolder:"\eAccountBilling.sql ":extractDate:" > AccountBilling.txt"
Call DSExecute("NT",cmd,output,rc)
I use one parameter extractDate to pass to sql script file eAccountBilling.sql
In script file, I specify that parameter as &1. When this job runs, the value of the parameter I passed is: 2006-09-30
This job works fine, however, the output file contains the query result and 2 extra lines as:
old 1: select * from ACW.Package a where a.MIS_UPDATE_DATE between trunc(cast('&1' as date) -1) and trunc(cast('&1' as date) -1) + 0.99999
new 1: select * from ACW.Package a where a.MIS_UPDATE_DATE between trunc(cast('2006-09-30' as date) -1) and trunc(cast('2006-09-30' as date) -1) + 0.99999
... query result goes here
Could somebody tell me how to remove those 2 extra lines from the output file? Thank you!