Aggregator | Books | Industry News | Firefox Plugins | Social | Links

Comments

Using Ref Cursors To Return Recordsets - Return recordsets from Oracle stored procedures.



Karthik said...

Average

Tim... said...

Hi.

Thanks for your input.

This type of opinion can be reflected adequately in the rating system.

Please use to comments for the correction of facts or suggestions to make the pages better.

Cheers

Tim...

db said...

i am doing similar to above but
building sql statement dynamically
and then -
open refcursor for query_str

but when i use the sample code to call the procedure and print the cols that gives me an error
ORA-01003: no statement parsed
i get the same error when i try to call this from java program as well, when it tries to get the resultset
pls help

Mond said...

Thank you for the info!

Vinay Paryani said...

This article gives a fair idea about REF Cursors to beginners.

Ramana said...

Hi
Good. This article gave the idea for the ref cursors. It fulfill my requirements. Thanks

Srikanth said...

Good info

Himanshu said...

Excellent article. Saved my time & solved my big big problem

Ted C. said...

The vb example is great but why use ODBC and not OLE DB. This way the machine doesn't need any ODBC setup at all.
"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;"


Tim... said...

My VB days are long behind me :)

Thanks for the advice though.

Cheers

Tim...

kmkongole@yahoo.com said...

The vb example is great but why use ODBC and not OLE DB. This way the machine doesn't need any ODBC setup at all.
"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;"

---comments----
in the above code if we use oledb then ,whenever system is updated the oledb behaves erraneously(this is not consistant error type),but to maintain uniformity and without any problem to work with, ALWAYS BETTER TO USE ODBC...
hope understood,,,,,

Kashyap said...

Good one. I was looking for only cursors but it also explained the usage of the same.
This saved my time for searching of the latter.

sivakumar said...

Good,need more infromation

Rahul said...

What happens if I use 'sys_refcursor'. Wouldn't the java code be able to pick it up in the resultset?

Rahul

Tim... said...

Questions in the forum, not in the comments!

SYS_REFCURSOR is no different to any other ref cursor type, it's just predefined to save you having to define one.

Cheers

Tim...

Anil Gupta said...

This code is giving below given error to me:

[Microsoft][ODBC driver for Oracle][Oracle]ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'TESTDSNPROC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Tim... said...

Hi.

At the time of writing, the ASP code worked fine. I have no idea if it still a valid syntax as I've not worked with ASP and Windows for years. I'm sure things are different now in the .NET world.

Cheers

Tim...

Madh00 said...

this is the article for what i was looking for ..other artciles misintrepet return to be returning cursors from function. This is a great one and most importantly, it is correct.

Surya said...

Thanks. Nice article to get a quick idea about ref cursors and their usage.

Lucio Espinoza said...

Thank you so much.

This simple article was very helpful.

vadym said...

very good tip

ponic said...

Tim

Is it better to use a procedure or function to return SYS_REFCURSOR? What is the best practice in this regard?

Tim... said...

Hi.

It doesn't matter. Use which ever you prefer.

Cheers

Tim...

VJ said...

That was quick overview of 9i vs 11g REF CURSOR data type.

Thanks.

jerry said...

Thank you, this was what I was looking for.

Krish said...

This was really helpful to me. Saved good amount of time.
Thanks.

DO NOT ask technical questions here, that's what my forum is for!

These comments should relate to the contents of a specific article. Constructive criticism is good. Advertising and offensive comments are bad and will be deleted!

Add your comments here.
Name
Comment
(max 400 chars - plain text)