[V4CC] sql syntax question

Dave Parizek david at parizek.com
Tue Jun 5 15:08:55 CDT 2007


I have a Cocoa newbie syntax question about syntax for using binds  
with SQL UPDATE statements:


I am trying to use binds on an UPDATE sql statement in V4CC, with  
following syntax:

query =@ "UPDATE table1 SET field1 = :1, field2 = :2 WHERE field3 =  
'some value'";

[binds addObject:stringValueForField1];
[binds addObject:stringValueForField2];

int rows = [mDatabase sqlExecute:query bind:binds];

rows comes back as 0 even though everything looks right, some value  
exists in database, etc.

Is it that I am using binding wrong?

also, is this one legal?:
query =@ "UPDATE table1 SET field1 = :1, field2 = :2 WHERE field3 = :3";


Thanks for any help or directions where to look...!
____________________
Dave Parizek

david at parizek.com





More information about the Valentina mailing list