ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calling oracle stored function with CLOB parameter (https://www.excelbanter.com/excel-programming/355001-calling-oracle-stored-function-clob-parameter.html)

Jlorga[_5_]

calling oracle stored function with CLOB parameter
 

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,


--
Jlorga
------------------------------------------------------------------------
Jlorga's Profile: http://www.excelforum.com/member.php...o&userid=31707
View this thread: http://www.excelforum.com/showthread...hreadid=518656



All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com