Solved

Perl - Recordset

Posted on 2004-03-25
4
667 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 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now