• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 699
  • Last Modified:

Perl - Recordset

I'm fetching data from the sql server into a perl recordset. I need to traverse thro' the recordset multiple times. How to proceed?
0
Karuppaiah
Asked:
Karuppaiah
1 Solution
 
davorgCommented:
What are you using to query the database and build the recordset? DBI or Win32::ODBC or something else?

It's hard to help without any real information and debugging by telepathy gives me a headache.

Dave...
0
 
PerlKingCommented:
You should be able to get the recordset into an array.
To take an example, assuming you are using DBI to connect to Oracle:

use DBI;

my $dbh = DBI->connect("dbi:Oracle:hostname", "username/password", "",);

my $results = $dbh->selectall_arrayref(qq{SELECT blah, blah FROM somewhere... });

Now $results is an array reference to the list of rows.
So you could traverse the list, back and forth, as many times as you want !!

Regards
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now