Supplying int to system.db.runPrepUpdate converts it into a list of binary bits

v8.1.41

v = 50
system.db.runPrepUpdate('INSERT INTO test (id) VALUES (?)', v)

Results in error:
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO test (id) VALUES (?), [0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], , , false, false)

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The index 2 is out of range.

Where that list of args reversed (b0000 0000 0000 0000 0000 0000 0011 0010) is 50 in decimal... What's going on?

v should be [v]. You didn't supply a list of parameters.

3 Likes

Derrrrrrr, of course, thanks :man_facepalming: Shouldn't be working at 9:30pm obviously

3 Likes