Storing Records to a cursor

  • HI ALL,

    I have a stored procedure that returns a set od rows.(proc1)

    i have another store proc. in which i need to call the proc1 and i want to store the returned rows into a cursor how to do it?

    is it possibel to declare a cursor like

    DECLARE c1 CURSOR FOR

     

    thannks and regds

    ramesh

  • You can only build a cursor using a SELECT statement.

    Use a temp table, e.g.

    CREATE TABLE #temp (col1, col2 ...)

    INSERT INTO #temp EXECUTE proc1

    DECLARE cursor_name CURSOR

    FOR SELECT col1, col2 ...

    FROM #temp

    etc.

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply