Hello,
I am trying to see if it is possible to use the sql variables with prep query.
The idea is to have something like that:
queryTest = "DECLARE @vWorkerID VARCHAR(30);SET @vWorkerID = ?; SELECT * FROM TbWorker WHERE WorkerID = @vWorkerID"
system.db.runPrepQuery(queryTest,'1234')
I get an error:
java.lang.ClassCastException: java.lang.ClassCastException: Cannot coerce value '1234' into type: class [Ljava.lang.Object;
Whereas if I do a normal query:
queryTest = "DECLARE @vWorkerID VARCHAR(30);SET @vWorkerID ='1234'; SELECT * FROM TbWorker WHERE WorkerID = @vWorkerID"
system.db.runQuery(queryTest)
I get a result.
Any advise ?
Julien