I am try to call a oracle stored procedure and pass it one parameter. I keep getting an error
argument wrong type, are out of acceptable range, or are in conflict with another.
If anyone can help i would appreciate any help. This is a test of what i need to start off with. I need to be able to call the stored proc and pass it one parameter. After i figure out how to get that to work i want to expand passing more parameters but i figure once i can get one to work adding others will be easy. I work best with samples of working code if you have any. Thanks in advance for any help
The stored proc looks like this and has one input called inputTest1 that I'm trying to pass it from the vbscript;
create or replace
PROCEDURE SP_TEST3
( inputTest1 IN VARCHAR2) AS
BEGIN
insert into mjatest (inputTest1,test2,test3) values (inputTest1,'3333','!@#$%');
END SP_TEST3;
My vbscript look like this:
teststrCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=somehost)(PORT=1212))" & _
"(CONNECT_DATA=(SERVICE_NAME=SID_NAME))); uid=xxx;pwd=xxx;"
Dim oCon
Set oCon = WScript.CreateObject("ADODB.Connection")
Dim oRs
oCon.Open teststrCon
Set cmdStoredProc = WScript.CreateObject("ADODB.Command")
Set cmdStoredProc.ActiveConnection = oCon
cmdStoredProc.CommandText = "SP_Test3"
cmdStoredProc.CommandType = 4 'defines cmd type as stored proc
cmdStoredProc.Parameters.Refresh
cmdStoredProc.Parameters.Append cmdStoredProc.CreateParameter("inputTest1",adVarChar,adParamInput,20,inputTest1)
cmdStoredProc.Execute
oCon.Close
argument wrong type, are out of acceptable range, or are in conflict with another.
If anyone can help i would appreciate any help. This is a test of what i need to start off with. I need to be able to call the stored proc and pass it one parameter. After i figure out how to get that to work i want to expand passing more parameters but i figure once i can get one to work adding others will be easy. I work best with samples of working code if you have any. Thanks in advance for any help
The stored proc looks like this and has one input called inputTest1 that I'm trying to pass it from the vbscript;
create or replace
PROCEDURE SP_TEST3
( inputTest1 IN VARCHAR2) AS
BEGIN
insert into mjatest (inputTest1,test2,test3) values (inputTest1,'3333','!@#$%');
END SP_TEST3;
My vbscript look like this:
teststrCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=somehost)(PORT=1212))" & _
"(CONNECT_DATA=(SERVICE_NAME=SID_NAME))); uid=xxx;pwd=xxx;"
Dim oCon
Set oCon = WScript.CreateObject("ADODB.Connection")
Dim oRs
oCon.Open teststrCon
Set cmdStoredProc = WScript.CreateObject("ADODB.Command")
Set cmdStoredProc.ActiveConnection = oCon
cmdStoredProc.CommandText = "SP_Test3"
cmdStoredProc.CommandType = 4 'defines cmd type as stored proc
cmdStoredProc.Parameters.Refresh
cmdStoredProc.Parameters.Append cmdStoredProc.CreateParameter("inputTest1",adVarChar,adParamInput,20,inputTest1)
cmdStoredProc.Execute
oCon.Close