Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle PL/SQL function call via ADO

Status
Not open for further replies.

jjob

Programmer
Jul 16, 2002
157
GB
Can anyone confirm that ADO will not allow a call to a user defined PL/SQL function?

If it is possible, I'd be very grateful for some advice on the syntax of calling this from VBScript/ASP.

TIA

John
 
oracle:
create function test() return number is
begin
return 1;
end;

VB:
Dim adoConn as Adodb.connection
Dim adors as Adodb.recordset

adoConn.open ("connectionString")
Set adors = adoconn.execute("select test() from dual")
msgbox adors(0)
'close conn and rs


note: this is just a sample not full source.

regards,
sudhi
 
Thanks sudhi,

I think I can see where I've been making my mistake now, I've been calling it in the same manner as a stored procedure as I needed to supply parameters.

regards

John
 
since it is a function, u can pass in the sql statement itself. if procedure use adoCommand and pass parameter.
regards,
sudhi
 
I may disprove this. BTW where did you find this info?

Code:
...
Set cmd = New ADODB.Command
cmd.CommandText = "{call OracleProcedure()}"
cmd.Execute

You may also use ? as parameter placeholder(s) and then call before Execute

Code:
Set prm = cmd.CreateParameter(...)
cmdExeproc.Parameters.Append prm
prm.Value = ...

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top