Home » Open Source » Programming Interfaces » Executing a Stored Procedure with visual basic 6 (Oracle 9.2e)
Executing a Stored Procedure with visual basic 6 [message #288171] Sat, 15 December 2007 05:48 Go to next message
grupoapunte
Messages: 5
Registered: September 2007
Junior Member
Hey, im developing an aplication that uses stored procedures from an oracle DB, i found a sample code to do this, but i think its a bit long if i have to do the same thing for every procedure, the question is if its posible to use the execute command with the procedure and the params all in one line, for example:

Set rsFiltro1 = cnOracleDb.Execute("PROCEDURE NAME AND PARAMS GOES HERE")


This is the sample code that i found:
Conn.Open "PROVIDER=OraOLEDB.Oracle;DATA SOURCE=xxxxx;” & _
“USER ID=xxxxxx;PASSWORD=xxxxxx;PLSQLRSet=1"
    
Cmd.ActiveConnection = Conn
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "AL_PACKAGE.AL_PROCEDURE1"

Cmd.Parameters.Append Cmd.CreateParameter("SiteID", adVarChar, adParamInput, 10, TxtQuery.Text)

Cmd.Parameters.Append Cmd.CreateParameter("ErrCode", adVarChar, adParamOutput, 10)

Set RS = Cmd.Execute


Thanks
Re: Executing a Stored Procedure with visual basic 6 [message #288176 is a reply to message #288171] Sat, 15 December 2007 07:37 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Long?
It is just writting letters.
Don't be so lazy, your generation can use copy and paste, so be happy.

There is no other way I am aware of.

Regards
Michel
Re: Executing a Stored Procedure with visual basic 6 [message #288177 is a reply to message #288171] Sat, 15 December 2007 07:44 Go to previous message
grupoapunte
Messages: 5
Registered: September 2007
Junior Member
hehehe yeah i know, but it is long because i have over 100 diferent stored procedures and copy paste wont work in this case becasue the procedures have diferent quatities of parameters. Anyway i just want to know if its posible to use execute("") so i just have to write the procedure name and params Smile
Previous Topic: Connection with the server (merged)
Next Topic: Maximum cursor overloaded problem
Goto Forum:
  


Current Time: Sat Oct 25 05:45:37 CDT 2014

Total time taken to generate the page: 0.05986 seconds