views:

28

answers:

1

Hi, I'm having a problem with an expression in my sql statement in SQLite for Adobe AIR

basically I have this

sql = "UPDATE uniforms SET status=@status WHERE customerId IN(19,20)";
updateStmt.parameters["@status"] = args[1];
updateStmt.execute();

if I run the above code it works, updating the status when the id are 19 and 20

but if I pass the ids list as a parameter like this

sql = "UPDATE uniforms SET status=@status WHERE customerId IN(@ids)";
updateStmt.parameters["@status"] = args[1];
updateStmt.parameters["@ids"] = "19,20";
updateStmt.execute();

it gives me and error, saying could not convert text value to numeric value, which make sense because I'm passing and string but the IN expression should convert it accordingly, like it does when I pass directly the list values, why is not working the other way, thanks for any help!

A: 

Not sure but I think the problem is that your @ids parameter should be an array when using it like this. Try

updateStmt.parameters["@ids"] = new Array(19,20);
invertedSpear