MySQL Sceme - "update" syntax
[1/4] from: fergus4:bellatlantic at: 12-Dec-2005 3:17
Does anyone know the syntax for the SQL "update" command,
I've been using Doc Kimmels SQL Protocol and I've been successful in
inserting rows but I have not been able to figure out the update row syntax.
To insert the data: empnum: "123" and lname: "Smith" I use the statement
below:
insert db ["insert into employes values (?,?)" empnum lname]
What is the syntax to update this row with the new value lname: "Jones"
WHERE empnum='123' but I'm using a variable for the "WHERE" part.
The following is wrong but it should look something like this:
insert db ["UPDATE employes SET (?,?)" lname fname "WHERE lname=(?)" lname]
[2/4] from: alberto:origen:mx at: 12-Dec-2005 2:29
On Mon, 12 Dec 2005 02:17:29 -0600, Alan Macleod
<fergus4-bellatlantic.net> wrote:
may you are looking for something like
insert db ["UPDATE employes SET clname=?,cfname=? WHERE cempnum=?"
lname fname empnum]
where 'clname','cfname' and 'cempnum' must by the name of the table
'employes' columns
[3/4] from: fergus4::bellatlantic::net at: 12-Dec-2005 18:09
Alberto,
Thanks for your help.
I got it to work!
Alan
[4/4] from: gchillemi::aliceposta::it at: 14-Dec-2005 8:23
> Does anyone know the syntax for the SQL "update" command,
> I've been using Doc Kimmels SQL Protocol and I've been successful in
> inserting rows but I have not been able to figure out the update row
> syntax.
...
Which version of MySQL are you using ? I have been not able to have a
permament connection to MySQL 5 because it dropped the connection after 3-4
seconds.
Giuseppe Chillemi