Results 1 to 8 of 8

Thread: output parameters

  1. #1
    Join Date
    Jan 2005
    Posts
    4

    Question output parameters

    There is an example of getting the value of an output parameter on aspdb.com [see below]. However, when I try this example with a MS SQL Server stored procedure the value is not in a Session value like is indicated in the example. I am using aspdb classic. Am I missing something or is this not an option in classic?

    <%
    Set Y=Server.CreateObject("ASP.DB")
    Y.dbUnit=5
    Y.dbDBType="SQL"
    Y.dbDSN="Provider=MSDAORA; data source=dell500; user id=scott; password=tiger"
    Y.dbStoredProcCmdParams="(;~){? = call ExFunct(?,?)}~1~NORS;Res~139~2~10;Num1~139~1~5~19; Num2~139~1~5~18"
    Y.dbDisplay=false
    Y.ASPDB
    response.write("<B>Input values Num1, Num2 = 19 and 18<BR>")
    response.write("Res holds the returned value of function of num1 + Num2 in a session variable SV_SP_Unit_VarName =" & session("SV_SP_5_res") & "</B>")
    %>
    Note: The returned variable is defined as Res~139~2~10 where 2 = Output. VarName=Res

  2. #2
    Join Date
    Oct 2002
    Posts
    93
    How about the example at:

    http://www.aspdbtest.com/examples/ep/V2_SP1.asp

    That's using Classic. Does that help?

    John

  3. #3
    Join Date
    Jan 2005
    Posts
    4
    Good example of using stored procedure but not one that uses output parameters. All of those examples use input parameters. I am interested in getting a recordset back and one [or two] output parameters. Like the example using Oracle in my original post.

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    I just updated the dbStoredProcCmdParams page with an output params example called #2005 at the very top.

    FK

  5. #5
    Join Date
    Jan 2005
    Posts
    4

    Exclamation

    Frank,
    Great example but this only seems to work if you declare 'NORS'. Is it not possible to return a recordset and a OUTPUT parameter in ASP-db? Thanks!
    Last edited by jwkelly; 02-07-2005 at 12:36 PM.

  6. #6
    Join Date
    Oct 2002
    Posts
    933
    I'll give it a try.. should be able to!! give me a day or two...

    FK

  7. #7
    Join Date
    Jan 2005
    Posts
    4

    Exclamation

    So I am going to assume this is not possible?

  8. #8
    Join Date
    Oct 2002
    Posts
    933
    Not, no possible to get both NORS=true and NORS=false returns in the same session. You need to speparte that into two step and get each one individually.

    Frank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •