Pass SQL results to array
Posted in 1998
Edward Villalovoz — — source: Informix-list mailing list archive (1991-1998)
Hi,
Can anyone show me how to pass my sql results to an array in perl
instead of UNLOADing them to a flat file, and then LOAD the array results
into another informix table? Thanks in advance.
#!/usr/local/bin/perl
$hh = 12;
$filename = "cool.txt";
$ENV{INFORMIXSERVER} = "n36_shm";
open DBACCESS, "| dbaccess" or die "Couldn't run dbaccess: $!; aborting";
print DBACCESS qq{
database pmsys\\@n36;
UNLOAD TO '$filename' DELIMITER '|'
SELECT ama_cfc
FROM tblamah
GROUP BY ama_direction, ama_cfc
HAVING ama_direction = "$hh"; };
close DBACCESS or die "Couldn't finish dbaccess: $!; aborting";