Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Perl - Recordset

Posted on 2004-03-25
4
Medium Priority
?
697 Views
Last Modified: 2006-11-17
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
Comment
Question by:Karuppaiah
4 Comments
 
LVL 8

Expert Comment

by:davorg
ID: 10677280
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
 
LVL 3

Accepted Solution

by:
PerlKing earned 2000 total points
ID: 10755912
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question