Re: Passing a table or cursor into a stored procedure

From: Russ Ferrill (rferrill_at_paracominc.com)
Date: 08/25/04

  • Next message: Ian Frawley: "Re: SQL Server monitoring"
    Date: Wed, 25 Aug 2004 16:22:36 GMT
    
    

    So, I guess that means that if I want a procedure to process the rows in a
    cursor created by the caller I have to create a cursor with a scope
    reachable by both the caller and the procedure?

    <hkvats_1999@yahoo.com> wrote in message
    news:68c8c86d.0408242313.7a155e02@posting.google.com...
    > Hi Ferrill,
    >
    > Cursor can be used as OUTPUT parameter only not as Input-Output. This
    > cursor will alow stored procedure to return a cursor as output.
    >
    > Regards
    > Hari Sharma
    >
    > "Russ Ferrill" <rferrill@paracominc.com> wrote in message
    news:<njJWc.12830$wN.2627@newssvr22.news.prodigy.com>...
    > > Thanks for the info. If I pass a cursor as an OUTPUT parameter, can I
    pass
    > > an actual cursor already declared with a select for loading the rows and
    > > then fetch those rows from within the stored procedure or is the cursor
    I am
    > > passing simply a means of allowing the stored procedure to return a
    cursor
    > > as output? Thanks again for any suggestions you may have.
    > >
    > >
    > > <hkvats_1999@yahoo.com> wrote in message
    > > news:68c8c86d.0408232133.7ef7b3e@posting.google.com...
    > > > Hi Ferrill,
    > > >
    > > > you can pass all data types, including text, ntext and image, as a
    > > > parameter to a stored procedure. However, the cursor data type can be
    > > > used only on OUTPUT parameters.
    > > >
    > > > Regards
    > > > Hari Sharma
    > > >
    > > > "Russ Ferrill" <rferrill@paracominc.com> wrote in message
    > > news:<xosWc.4753$gx7.2216@newssvr23.news.prodigy.com>...
    > > > > I have a stored procedure that I would like to be able to pass a
    table
    > > or
    > > > > cursor into so that it will process whatever records are contained
    in
    > > the
    > > > > input data. Is there any way to do this in T-SQL? If not, can
    somebody
    > > > > suggest a good workaround? Thanks very much in advance.


  • Next message: Ian Frawley: "Re: SQL Server monitoring"

    Relevant Pages

    • Re: How to use CURSOR with SELECT * ?
      ... It's described in the article about DECLARE CURSOR. ... Specifies that the scope of the cursor is local to the batch, ... An OUTPUT parameter is used to pass the local ... cursor back to the calling batch, stored procedure, or trigger, which can ...
      (microsoft.public.sqlserver.programming)
    • Re: aout cursor staoed procedure and vb6 (ado)
      ... I correct stored procedure name of prefix ... cursor on runing row by row. ... > 2) The RETURN value is not an OUTPUT parameter. ... >> DECLARE curBsDetail CURSOR FOR ...
      (microsoft.public.data.ado)
    • Re: Passing a table or cursor into a stored procedure
      ... If I pass a cursor as an OUTPUT parameter, ... then fetch those rows from within the stored procedure or is the cursor I am ... > you can pass all data types, including text, ntext and image, as a ...
      (microsoft.public.sqlserver.programming)
    • Re: Passing a table or cursor into a stored procedure
      ... If I pass a cursor as an OUTPUT parameter, ... then fetch those rows from within the stored procedure or is the cursor I am ... > you can pass all data types, including text, ntext and image, as a ...
      (microsoft.public.sqlserver)
    • Re: Stored Procedure, Output Value with SELECT Statement
      ... you are best off with the Set NoCount On in your procedure. ... your output parameter will only be available to your client code ... after you have read all of the select cursor on your client connection. ... load the recordset into an array or something so that you can get to ...
      (microsoft.public.data.ado)