Solved

Perl - Recordset

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove Malware code from PHP file 6 82
syslog unix file 20 71
Perl Script to read file contents, make changes, and build new file 7 111
Regex rule to match two different url 5 71
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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

15 Experts available now in Live!

Get 1:1 Help Now