msql insert new record

Robert Mann robmann at gp-racing.com
Sun Oct 22 19:40:03 EDT 2006


I have put all my table names into
colnames each separated by a ,

I have also put all new values into colvalues each separated by a ,

can someone tell me the proper format for the following insert statement for
RR

put "INSERT INTO rider (colnames) VALUES (colvalues)" into tSQL

Thanks


Robert Mann


-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Jim Ault
Sent: Sunday, October 15, 2006 8:16 PM
To: How to use Revolution
Subject: Re: msql insert new record


On 10/15/06 4:14 PM, "Robert Mann" <robmann at gp-racing.com> wrote:

> have a update code that works great, with some held form this list
>
> put "UPDATE rider SET "&updateColValListOf123Pairs&" WHERE record_id = '"
&
> fld "record_id" & "'" into tSQL
>
> how would I change this to insert a new record
>
> put "INSERT INTO rider "&updateColValListOf123Pairs&" " into tSQL
>
> the above does not seem to work?
>
UPDATE   &  INSERT INTO  don't use the same format
INSERT INTO does not use "="

on of the many reference pages on the web
 http://w3schools.com/sql/default.asp
--------------------------------
INSERT INTO table_name
VALUES (value1, value2,....)
--which puts the values into the first col, second, etc.

You can also specify the columns for which you want to insert data:
INSERT INTO table_name (column1, column2,...)
VALUES (value1, value2,....)
---------------
UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value
> put "UPDATE rider SET "&updateColValListOf123Pairs&" WHERE record_id = '"
&
> fld "record_id" & "'" into tSQL
>

Jim Ault
Las Vegas


_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list