Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Oracle can't return recordset ?!

Author  Topic 

majkinetor
Yak Posting Veteran

55 Posts

Posted - 2006-05-18 : 05:37:27
We recently installed Oracle 10g here, and I was amazed that this database can not return recordset from store procedure, but it apperently always use cursors ?! AFAIK in Sql Server this is the last method to do when speed is in concern. Orcale uses something known as REF CURSOR.

I know that this is not place to ask questions about Oracle, but question is general and theoretical and people here are devoted to databasees. Isn't this strange ? Maybe Oracle did some hell optimization for cursors so they don't suffer from same speed degradations like in SQL Server (I doubt so, since IBM DB2 also doesn't recomend cursors).

Anyway, does anybody know something about this? Maybe there is some way to return recordsets without cursors (I heard something about VARRAYS). What do you think about this, anyway ?

www.r-moth.com          http://r-moth.deviantart.com

nr
SQLTeam MVY

12543 Posts

Posted - 2006-05-18 : 06:50:15
It's necessary for returning a resultset (which is ordered). SQL server will also create a cursor for the resultset it's just that it does it for you and you don't have to do it explicitly.
You could say that oracle gives you more control at the expense of having to work a bit harder.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2006-05-19 : 00:30:59
Oracle & SQL Server are completely different databases with completely different implementations. What is true for one may not be true for another.

Unfortunately you need to learn a fair amount about both in order to make these judgements. In Oracle, returning a ref cursor is essentially the same as returning a recordset and the proper way of doing it. Don't get too distracted by your experience with SQL server. Check out http://asktom.oracle.com for loads of interesting help and snippits of information about Oracle.
Go to Top of Page

majkinetor
Yak Posting Veteran

55 Posts

Posted - 2006-05-19 : 03:02:28
quote:
SQL server will also create a cursor for the resultset it's just that it does it for you and you don't have to do it explicitly.

If recordsets are implemented as implicit cursors, I don't know why should I avoid cursors ?!

quote:
What is true for one may not be true for another.

I am well aware of that. I didn't came here to ask how to do this in Oracle the same way I used to do in SQL Server, but I was just confused with this fact that Oracle doesn't support recordsets without cursors, which is essential functionality. Now, knowing that there is always implicit cursor I don't have further questions.

Thank you for your time.

www.r-moth.com          http://r-moth.deviantart.com
Go to Top of Page
   

- Advertisement -