February 26, 2004 at 4:52 am
What is the equivalent for USING of Oracle in SQL Server
say OPEN CURSOR NAME FOR SQLVAL USING a_IN.
February 26, 2004 at 6:00 am
I don't know Oracle, but I would take a look at BOL for DECLARE CURSOR
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
February 28, 2004 at 2:01 am
Using is as good as passing the input parameters to SQL Query used in the cursor :
In Oracle in the example that you sited basically SQLVAL should have been a Dynamic SQL framed on some criteria which needs some variables to be passed to it. In SQL Server the same can be achieved by passing the value to the Query in the cursor like
Declare CURSORNAME cursor for
Select * from Table1 where field1=@a
Where @a is equivalent to a_in in your example.
Prasad Bhogadi
www.inforaise.com
March 1, 2004 at 12:37 am
Erland Sommarskog has written something about dynamic sql along with Cursors here http://www.sommarskog.se/dynamic_sql.html
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply