Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 (Pilgrim)
on Nov 25, 2013 at 06:30 UTC ( #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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-10-23 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls