passing parameter from vbscript to oracle stored procedure
Dim strConnection, conn, rs, strSQL, objCommand, param strConnection = "Driver={Oracle ODBC Driver};Data Source=DSNNAME;User Id=Username;Password=password;" Set conn = CreateObject("ADODB.Connectio开发者_开发知识库n") conn.Open strConnection
Dim cmdInsert As ADODB.Command
Set cmdInsert = New ADODB.Command
cmdInsert.ActiveConnection = conn
cmdInsert.CommandText = "sp_ins_test"
cmdInsert.CommandType = 4
cmdInsert.Parameters.Refresh
Set param = cmdInsert.Parameters
param.Append cmdInsert.CreateParameter("v_BG_EI_DEFECT_TYPE", 200, 1, 100, "abc")
param.Append cmdInsert.CreateParameter("v_BG_EI_APP_ID", 3, 1, 8, 1)
param.Append cmdInsert.CreateParameter("v_BG_DETECTION_DATE", 133, 1, 100, 8/6/2010)
cmdInsert.Execute
It is throwing error as Character to number conversion error but i am passing int the code is 3 for integer(but the datatype is number in database) and also passing date
Please tell me how to pass parameters to date and number datatype in oracle..
I can see at least these problems:
- If the script really shall be VBScript, then
As ADODB.Command
andNew ADODB.Command
are illegal; these are valid in VB only. UseCreateObject
instead. 8/6/2010
is not a valid date literal, it is an integer expression evaluating to a very small value (almost 0); use#8/6/2010#
instead.
I hope this helps.
You are passing in empty strings
into your parameters.
精彩评论