calling oracle stored function with CLOB parameter

J

Jlorga

Hi,

I'm trying to call an Oracle function with ADODB command that receives
a CLOB parameter, but i don't know what is the correspondent.

I have the following code:

Dim con As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim InputParam As New ADODB.Parameter
Dim ReturnParam As New ADODB.Parameter
Dim auxString As String

auxString = xmlDoc.documentElement.XML
con.ConnectionString = "connection string"
con.Open
cmd.ActiveConnection = con
cmd.CommandText = "MY_PACK.Insert_Data"
cmd.CommandType = adCmdStoredProc
Set InputParam = cmd.CreateParameter("input", adLongVarChar,
adParamInput, , auxString)
Set ReturnParam = cmd.CreateParameter("output", adNumeric,
adParamReturnValue)

cmd.Parameters.Append ReturnParam
cmd.Parameters.Append InputParam

cmd.Execute
MsgBox "Input Value = " & cmd.Parameters(1)
MsgBox "Return Value = " & cmd.Parameters(0)
conn.Close

but i got the following error - Parameter object is improperly defined.
Incosistent or incomplete information was provided - in this line:
cmd.Parameters.Append InputParam

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top