Oracle Migration to SQL Server

  • What  is  the  equivalent  for USING of Oracle in SQL Server

    say   OPEN CURSOR NAME FOR SQLVAL USING a_IN.

     

     

  • 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]

  • 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

  • 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