|
|
sybperl-l Archive
Up Prev Next
From: "Lee Falkenhagen" <falkenl at HOTMAIL dot COM>
Subject: getting results from select in an associative array
Date: Jul 23 1998 4:28PM
I am executing a stored procedure that executes as its last statement a
select statement. When in WISQL, the sp returns the rows in order.
However, with the following code, it returns the rows a different order.
I can not figure out what order it returns it in.
I need to keep the results in the same order because I am creating a
flat file to load on a mainframe. I need to have the key, because,
later in the loop, I do not want to print certain columns.
Anyone know how to get the columns in the order of the select?
$::dbh->dbcmd("exec proc_oi_case ");
$::dbh->dbsqlexec();
$::dbh->dbresults();
if ($::dbh->DBROWS ne FAIL) {
$dbh1 = Sybase::DBlib->dbopen();
$dbh1->dbuse($::DBNAME);
open(OUTPUT, ">".$::SOURCEDIR."kc.kc300100.data");
$l_datacount = 0;
while (%data = $::dbh->dbnextrow(1)) {
while (($key,$value) = each %data) {
print "key = $key \n";
print OUTPUT "$value";
}
....
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
|