stored procedure problem

Discussion in 'ASP General' started by Savas Ates, Sep 7, 2004.

  1. Savas Ates

    Savas Ates Guest

    CREATE PROCEDURE zzz @userid numeric(18),@polim numeric(18) OUTPUT
    AS


    select * from users where userid=@userid

    select @polim= count(*) from users
    return (@polim)
    GO

    *********************
    how can i gain the value of @polim in asp

    in asp

    set rs=baglantim.execute ("declare @sa as int exec zzz @userid='21',
    @polim=@sa OUTPUT")

    response.write rs("@sa")
    like this (only i tried i dont know how can i gain the value it with execute
    method....)
    Savas Ates, Sep 7, 2004
    #1
    1. Advertising

  2. 1. a RETURN value and OUTPUT value are differenct.
    2. You can only RETURN an integer value.
    3. Your SP RETURNS and OUTPUTS the count value.

    To see how to use them from ASP, read

    http://www.adopenstatic.com/faq/recordcountalternatives.asp
    and http://www.adopenstatic.com/faq/SprocsAndParameters.asp



    --
    Roji. P. Thomas
    Net Asset Management
    https://www.netassetmanagement.com


    "Savas Ates" <> wrote in message
    news:...
    > CREATE PROCEDURE zzz @userid numeric(18),@polim numeric(18) OUTPUT
    > AS
    >
    >
    > select * from users where userid=@userid
    >
    > select @polim= count(*) from users
    > return (@polim)
    > GO
    >
    > *********************
    > how can i gain the value of @polim in asp
    >
    > in asp
    >
    > set rs=baglantim.execute ("declare @sa as int exec zzz @userid='21',
    > @polim=@sa OUTPUT")
    >
    > response.write rs("@sa")
    > like this (only i tried i dont know how can i gain the value it with

    execute
    > method....)
    >
    >
    Roji. P. Thomas, Sep 7, 2004
    #2
    1. Advertising

  3. Roji. P. Thomas wrote:
    > 1. a RETURN value and OUTPUT value are differenct.
    > 2. You can only RETURN an integer value.
    > 3. Your SP RETURNS and OUTPUTS the count value.
    >
    > To see how to use them from ASP, read
    >
    > http://www.adopenstatic.com/faq/recordcountalternatives.asp
    > and http://www.adopenstatic.com/faq/SprocsAndParameters.asp
    >
    >
    >

    The second FAQ article is very relevant. The only thing I have to add is
    that stored procedure code generators exist. There's been a VB Addin
    available for years that generates the VB code needed to create a Command
    object and build the Parameters collection. I adapted that Addin, fixing a
    couple deficiencies along the way, to enable it to generate the equivalent
    vbscript code. It is available here:
    http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear

    Since you will have the source code, you will be able to modify it to do
    what you want (say, for example, you don't like the variable names I used:
    modify the vbscript to use your variable names.)


    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Sep 7, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leon Shaw

    Stored Procedure Problem

    Leon Shaw, Jul 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    362
    Jurjen de Groot
    Jul 29, 2003
  2. ElmoWatson

    Stored Procedure/Parameter problem

    ElmoWatson, Aug 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    482
    Jerry
    Aug 6, 2003
  3. Bilbo
    Replies:
    3
    Views:
    407
    Bilbo
    Nov 20, 2003
  4. The Clansman

    Stored Procedure problem

    The Clansman, May 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    343
    Julie
    May 19, 2004
  5. Mike P
    Replies:
    0
    Views:
    3,275
    Mike P
    Jun 19, 2006
Loading...

Share This Page