sqlite and update

Christian Langers christian.langers at education.lu
Mon Aug 6 13:11:29 EDT 2007


Hello,

The  SQL syntax for Update is :

UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value

Here is a good reference : <http://w3schools.com/sql/sql_update.asp>


e.g.
put "UPDATE Schueler SET Name="& "tName"&","&&   
"Vorname="&tVorname&","&& "Strasse="&tStrasse&"," &&"Hausnr="&  
tHausnr&","&& "PLZ="& tPLZ&","&& "Ort="&tOrt&","&&  
"Gebdatum="&tGebdatum&","&&"Tel1="& tTel1&","&&"Tel2="&tTel2&","&&  
"Tel3="& tTel3&","&& "Geschl="& tGeschl&","&&  
"Konf="&tKonf&","&&"Staatsang="& tStaatsang&","&& "Klasse="&  
tKlasse&","&& "Nachname2="& tName2&","&& "Nachname3="&tName3&","&&  
"Email="& tEmail&&"WHERE rowID=1"  into tSQL

you have to know the rowId here...

But it seems that you are updating all of your fields ; I would  
suggest to use the REPLACE INTO Statement instead...

sql-statement ::=
REPLACE INTO [database-name .] table-name [( column-list )] VALUES  
( value-list ) |
REPLACE INTO [database-name .] table-name [( column-list )] select- 
statement

Look here for more information : <http://www.sqlite.org/ 
lang_replace.html><http://www.sqlite.org/>



Hope this helps,

Christian Langers




More information about the use-livecode mailing list