Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Korn shell script

536455Sep 28 2006 — edited Sep 29 2006
Hi,
I have created korn shell script whoch takes records and spool into file as every column is ~ seperated. At the last I have to show total count as this one
'[EOF <<count>>]' It is displaying but '[EOF' at one line and then ACTUAL COUNT value at next line.code is like this
cnt variable in this I already take as count from query. Can anybody helps me?
CREATEOUTPUT=`sqlplus -s $DATABASE@$ORACLE_SID <<SQLSCRIPT

set heading off;
set feedback off;
set echo on;
set verify off;
set linesize 150;
set pagesize 0;

spool $filename
/* 1.0 version developer needs to be change this with every relase*/
SELECT '$BILL_SYSTEM'||' '||to_char(gnvgen.systemdate,'DD/MM/YYYY HH:MI:SS')||' '||'1.0' from dual;

SELECT b.account_num ||'~'||
FROM pvaccount12 b,pvcustomer7 c,PROVIDER d,pvcustomertype2 e,pvbillsummary13 f
WHERE b.customer_ref=c.customer_ref
AND c.PROVIDER_ID= d.PROVIDER_ID
AND c.customer_type_id = e.CUSTOMER_TYPE_ID
AND f.account_num = b.account_num
AND F.OUTSTANDING_DEBT_MNY <>0
AND b.invoicing_co_id=3
AND trunc(f.bill_dtm) <= trunc(gnvgen.systemdate)
ORDER BY b.account_num;


SELECT '[EOF'||'$cnt'||']' FROM dual;


spool off;
/
exit
SQLSCRIPT
`
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2006
Added on Sep 28 2006
1 comment
1,148 views