adding data to a mysql table using zeos database on Kylix 3

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
windy
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 24.08.2005, 06:06
Location: NZ
Contact:

adding data to a mysql table using zeos database on Kylix 3

Post by windy »

Hi
great to see a forum, good work guys :)
NOw, I am using zeos databsase on kylix 3
I can successfully login into a mysql server
good
and i can set to use the table needed
but I am not sure of how to add records to the table....
i see you have some very brief examples in the FAQ seciton of this forum...
can you exapnd on those snippets, i.e just a simple code snippet to update a table (where you know the fields. i.e you add data to each field in the table (i guess using the batch command)
thanks very much!!!
Brian
Ps, how can I make a paypal donation to the cause?
thanks!
wserg
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 07.09.2005, 06:53
Contact:

Post by wserg »

Hi,

Very easy.
i.e, you have placed on form ZBatchSQL component and called it as dbSQL. In order to insert new record just set SQL property to 'INSERT INTO table SET f1='', f2=''' and so on.

If you want to update an existing record/records set SQL property to
'UPDATE table SET f1='' WHERE keyf1='''

To execute your SQL statement you can by dbSQL.ExecSQL

Hope it helps.
Best regards,
wserg
Post Reply