All

I have the below sql, it returns two rows, and I need to pass these two dates 
and run another sql, how do I do that..  basically I need to run the sql two 
times with two different time periods

$csr_dates =<<"END_OF_SQL";
SELECT sysdate beg_date
from dual
union
select sysdate -1 beg_date
from dual
END_OF_SQL

$csr_dates = $dbh->prepare($sql_dates)
   or die "Prepare of csr_dates failed due to $DBI::errstr\n$sql_main\nFile: 
".__FILE__."\nLine:". __LINE__.
"\n";
$csr_dates->execute
   or die "Execute of csr_dates failed due to\n";
## Fetch ALL the dates data
$dates_ref = $csr_dates->fetchall_arrayref()
   or die "Fetch of csr_dates failed due to $DBI::errstr";
$csr_dates->finish();

$sql_contracts =<<"END_OF_SQL";
select agrmt_id
from agreements
where date_id = '$beg_date'
END_OF_SQL
 
Praveen
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to