See IPC::Runopen (WFH1, '>', "${basePath}/QueryResult4.txt") or die "$!"; run "$SQLPLUS \@${basePath}/VoucherQuery4.sql $startdate", undef, \*WF +H1;
In response to your question here http://stackoverflow.com/questions/27597811/how-to-increase-efficiency-of-perl-script-which-uses-sqlplus, consider using a sub-select query## Using run() instead of system(): use IPC::Run qw( run timeout ); run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?"
-- input parameter var date1 varchar2(8); exec :date1 := &1; -- no headers SET PAGESIZE 0; SELECT s.SERIALNUMBER,s."STATE",s."AT",s.OPERATORID FROM sample s WHERE SUBSTR("AT",1,8) = :date1 AND SERIALNUMBER IN ( SELECT SERIALNUMBER FROM ( SELECT t.SERIALNUMBER, Count(*) FROM sample t WHERE SUBSTR(t."AT",1,8) = :date1 GROUP BY t.SERIALNUMBER HAVING Count(*) > 1 ) ) ORDER BY s.SERIALNUMBER,s."AT"; EXIT;
In reply to Re^5: How to handel sqlplus error in perl script.
by poj
in thread How to handel sqlplus error in perl script.
by Ankur_kuls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |