Oracle Stored Procedures

Results 1 to 4 of 4

Thread: Oracle Stored Procedures

  1. #1
    G.Singh Guest

    Default Oracle Stored Procedures

    How can you run oracle stored proecedures through an .asp page?<BR>e.g. in sqlplus you would run a procedure as<BR>exec grantrole(&#039connect&#039,&#039test1&#039);<BR>w here paramter1 is Roles and parameter2 is Username.

  2. #2
    Vipul Desai Guest

    Default RE: Oracle Stored Procedures

    I can&#039t give you a detailed answer, but this is possible if you use ADO -- simply look at the Connection and Command Objects. <BR><BR>A good book on this is by Nick Snowdon who has a book about interfacing VB and Oracle. The book is also usable in ASP applications.<BR><BR>&#062;&#062; Vipul

  3. #3
    G.Singh Guest

    Default RE: Oracle Stored Procedures

    &nbsp;<BR>This is what I tried !<BR> Session.timeout = 60<BR> Set dbConn = Server.CreateObject("ADODB.Connection")<BR> Set cmdPR = Server.CreateObject("ADODB.Command")<BR> DSN,USERNAME,PASSWORD<BR> cmdPR.CommandText = "exec oraadm.grantrole"<BR> cmdPR.CommandType = adCmdStoredProc<BR> cmdPR.ActiveConnection = dbConn<BR> set parm = cmd.CreateParameter("Roles",adVarChar,adParamInput ,200,"connect")<BR> cmdPR.Parameters.Append parm<BR> set parm = cmd.CreateParameter("Username",adVarChar,adParamIn put,10,Username)<BR> cmdPR.Parameters.Append parm<BR> cmdPR.Execute<BR><BR>I get an ORA-900 error "Invalid SQL Statement"<BR>Can anyone tell me what I&#039m doing wrong?

  4. #4
    Brad Kingsley Guest

    Default RE: Oracle Stored Procedures

    Here&#039s a sample for you...<BR><BR> Dim objConnection, objCommand, objParameter<BR><BR> &#039Open connection<BR> Set objConnection = CreateObject("ADODB.Connection")<BR><BR> objConnection.Open Application("Security_ConnectionString") <BR> objConnection.CursorLocation = adUseClient <BR><BR> &#039Open command object<BR> Set objCommand = CreateObject("ADODB.Command")<BR> objCommand.CommandText = "CheckLogon"<BR> objCommand.CommandType = adCmdStoredProc <BR><BR> &#039 Append parameters<BR> Set objParameter = objCommand.CreateParameter("username",adVarChar,ad ParamInput,40,username)<BR> objCommand.Parameters.Append objParameter<BR> Set objParameter = objCommand.CreateParameter("password",adVarChar,ad ParamInput,40,password)<BR> objCommand.Parameters.Append objParameter<BR> Set objParameter = objCommand.CreateParameter("SecurityString",adLong VarChar,adParamOutput,1024)<BR> objCommand.Parameters.Append objParameter<BR> <BR> &#039Execute the command<BR> Set objCommand.ActiveConnection = objConnection<BR> objCommand.Execute<BR> <BR> CheckLogon = objCommand(2)<BR> objConnection.Close<BR> set objParameter = nothing<BR> set objCommand = nothing<BR><BR>-Brad Kingsley, MCP - NT, IIS4<BR>Reliable Windows NT Web Hosting<BR>ORCS Web, Inc -<BR>

Posting Permissions

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