Oracle Stored Procedures

Results 1 to 2 of 2

Thread: Oracle Stored Procedures

  1. #1
    G.Singh Guest

    Default Oracle Stored Procedures

    I need help with running an oracle stored procedure using ado.<BR>e.g. <BR>the procedure can be run in oracle as <BR>SQL&#062; exec grantrole(&#039connnect&#039,&#039test1&#039);<BR> where the procedure is grantrole(Roles varchar2, Username varchar2)<BR><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?

  2. #2
    Jack van Dijk Guest

    Default RE: Oracle Stored Procedures

    The CommandText should be "oraadm.grantrole" instead of <BR>"exec oraadm.grantrole". So remove the &#039exec &#039 and is should work fine.

Posting Permissions

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