I need to write a little VBScript to call a SQL procedure with an input variable. I don't have to much experience with VBscript and I'm getting an error for which I can't find a solution. The error I am receiving is:
OnNewRecord (Line 14): [ODBC Firebird Driver][Firebird]Dynamic SQL Error Input parameter mismatch for procedure TEST
The VBScript I wrote is:
Const Connection = "DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=masterkey;DBNAME=C:\Users\wouter\FOR-TESTING.fdb;"
Const adParamInput = 1
Const adInteger = 3
Set myConn = CreateObject("ADODB.Connection")
myConn.Open Connection
Set spCommand = CreateObject("ADODB.Command")
spCommand.Commandtext = "TEST"
spCommand.CommandType = 4
Set parameter = spCommand.CreateParameter(, adInteger, adParamInput, 4, 5)
Set spCommand.ActiveConnection = myConn
spCommand.Execute
myConn.Close
This VBscript is calling the following procedure:
CREATE OR ALTER PROCEDURE TEST (ID INTEGER)
AS BEGIN
UPDATE MATERIAL_LABEL SET PRINTED = 'T', HANDLED_DATE = CURRENT_TIMESTAMP
WHERE ID = :ID;
END
ID INTEGER
should be a variable input but for testing the code I'm using the numeric value 5. I think it has something to do with the procedure requiring a different type of input but I can't find which.