Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Is it possible to run SQL select in Oracle and SQL Server to get a large recordset and import it straight into an array, looking to avoid using rownext

by einhverfr (Friar)
on Nov 25, 2013 at 06:30 UTC ( [id://1064195]=note: print w/replies, xml ) Need Help??


in reply to Is it possible to run SQL select in Oracle and SQL Server to get a large recordset and import it straight into an array, looking to avoid using rownext

In addition to the suggestion for selectall_arrayref method (or fetchall_arrayref/fetchall_hashref) I am going to suggest the possibility of pushing this back to someone else's problem. In your case it sounds like you may be joining two result sets across databases. If this is just a union, then go ahead and do it all in Perl, but if it is a join or anything more complex, avoid doing it in Perl if you can. Databases usually handle this task better than anything you can put together.

SQL Server supports linked servers over ODBC, so it can pull the data from Oracle, join with its own data and give you a result. Oracle supports the same over OCI. So if you need SQL-like logic linking the data sets, you are best to do it this way.

I mention this because there may be plenty of cases where you really want to do things in the db instead of retrieving a lot of rows you will need to process. DB's have fine-tuned algorithms for these sort of operations and an ability to select between them.

  • Comment on Re: Is it possible to run SQL select in Oracle and SQL Server to get a large recordset and import it straight into an array, looking to avoid using rownext
  • Watch for: Direct replies / Any replies

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1064195]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found