Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: Calling Oracle Stored Procedures in ASP


Message #1 by "Gavin Landon" <glandon@g...> on Thu, 18 Apr 2002 13:36:39 -0500
I usually call my stored procs like this:

Set conn=Server.CreateObject("ADODB.connection")
conn.Open "DSN=ACCE; uid=login; pwd=passwd"

set rs = conn.Execute("sp_MyProc '" & sVar1 & "', '" & sVar2 & "'")

<anhdo@a...> wrote in message news:166184@a..._databases...
>
> I have a procedure called Validateloginbyuserpass that I need to call in
> ASP.  It needs a username and password and it returns values.  Here is
> what I have so far:
> _______
> Username="jenny"
> Userpassword="jennypassword"
>
> Dim cmd,conn, orst
> Set cmd=Server.CreateObject("ADODB.Command")
> Set conn=Server.CreateObject("ADODB.connection")
> conn.Open "DSN=ACCE; uid=login; pwd=passwd"
> Set cmd.ActiveConnection=conn
>
> cmd.CommandText="{CALL Validateloginbyuserpass ('" &cstr(username)&"', '"
> & cstr(userpassword)&"')}"
> cmd.CommandType=1
>
> Set orst=server.CreateObject("ADODB.recordset")
> Set orst=cmd.execute
>
> Response.write orst("P_First_Nm") 'write user first name given a login
> _____
>
> When I run this page I get a query error saying "wrong number or types of
> arguments".  How can I call this procedure correctly?  Here are the
> parameters in the procedure:
>
> PROCEDURE VALIDATELOGINBYUSERPASS (Login with Username/Password
> Combination)
>  Argument Name                  Type                    In/Out Default?
>  ------------------------------ ----------------------- ------ --------
>  P_LOGIN_ID                     VARCHAR2(200)           IN
>  P_PASSWD                       VARCHAR2(30)            IN
>  P_CUST_ID                      VARCHAR2(10)            OUT
>  P_FIRST_NM                     VARCHAR2(30)            OUT
>  P_LAST_NM                      VARCHAR2(30)            OUT
>  P_HASH_CD                      VARCHAR2(30)            OUT
>  P_EMAIL                        VARCHAR2(2000)          OUT
>  P_AUTH_ROLE                    VARCHAR2                OUT
>  P_RESULT                       VARCHAR2                OUT
>  P_RESULT_MSG                   VARCHAR2                OUT
>
> Thanks for any help,
> Anh Do
> anhdo@a...
>
>


Message #2 by anhdo@a... on Wed, 17 Apr 2002 20:04:25
I have a procedure called Validateloginbyuserpass that I need to call in 
ASP.  It needs a username and password and it returns values.  Here is 
what I have so far:
_______
Username="jenny"
Userpassword="jennypassword"

Dim cmd,conn, orst
Set cmd=Server.CreateObject("ADODB.Command")
Set conn=Server.CreateObject("ADODB.connection")
conn.Open "DSN=ACCE; uid=login; pwd=passwd"
Set cmd.ActiveConnection=conn

cmd.CommandText="{CALL Validateloginbyuserpass ('" &cstr(username)&"', '" 
& cstr(userpassword)&"')}"
cmd.CommandType=1

Set orst=server.CreateObject("ADODB.recordset")
Set orst=cmd.execute

Response.write orst("P_First_Nm") 'write user first name given a login
_____

When I run this page I get a query error saying "wrong number or types of 
arguments".  How can I call this procedure correctly?  Here are the 
parameters in the procedure:

PROCEDURE VALIDATELOGINBYUSERPASS (Login with Username/Password 
Combination)
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 P_LOGIN_ID                     VARCHAR2(200)           IN
 P_PASSWD                       VARCHAR2(30)            IN
 P_CUST_ID                      VARCHAR2(10)            OUT
 P_FIRST_NM                     VARCHAR2(30)            OUT
 P_LAST_NM                      VARCHAR2(30)            OUT
 P_HASH_CD                      VARCHAR2(30)            OUT
 P_EMAIL                        VARCHAR2(2000)          OUT
 P_AUTH_ROLE                    VARCHAR2                OUT
 P_RESULT                       VARCHAR2                OUT
 P_RESULT_MSG                   VARCHAR2                OUT
 
Thanks for any help,
Anh Do
anhdo@a...

  Return to Index