You can only insert into one table at a time that way:

INSERT INTO HERDING (show_id)
VALUES (14)


You could probably do a loop over a list of table names, since the field
name and new value is the same:

<cfset myTables = 'HERDING, WORKING, TOY, TERRIER, SPORTING,  NON_SPOR,
HOUND')>

<cfloop list="#myTables#" index="ii">
        <cfquery name="doIt" database="myDB">
        INSERT INTO #ii# (show_id)
        VALUES (14)
        </cfquery>
</cfloop>





Jeff Beer
Senior Programmer Architect
Hydrogen Media, Inc
(727) 530-5500 x303
[EMAIL PROTECTED]


> -----Original Message-----
> From: C Frederic Valone [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 08, 2001 1:47 PM
> To: CF-Talk
> Subject: query troubles
>
>
> hello,
> Can anyone show me what is wrong with this query? I know that
> I really should use another method to put this information into the
> database (triggers or sps come to mind) but I am using dbf
> files exported out of access on a unix box to prototype the app and
> they do not support these functions.
>  Here is the error
>
> ODBC Error Code = 37000 (Syntax error or access violation)
>
>  [MERANT][ODBC dBase driver]Missing VALUES keyword in INSERT statement
>
>  SQL = "insert into HERDING, WORKING, TOY, TERRIER, SPORTING,
> NON_SPOR, HOUND (HERDING.SHOW_ID, WORKING.SHOW_ID,
>  TOY.SHOW_ID, TERRIER.SHOW_ID, SPORTING.SHOW_ID,
> NON_SPOR.SHOW_ID, HOUND.SHOW_ID) values (14, 14, 14, 14, 14, 14, 14)"
>
> and here is the query
>
> <cfquery name="insert_show_id" datasource="#dsds#" dbtype="ODBC">
> insert
> into HERDING, WORKING, TOY, TERRIER, SPORTING, NON_SPOR, HOUND
> (HERDING.SHOW_ID, WORKING.SHOW_ID, TOY.SHOW_ID,
> TERRIER.SHOW_ID, SPORTING.SHOW_ID, NON_SPOR.SHOW_ID, HOUND.SHOW_ID)
> values(#trim(show_id)#, #trim(show_id)#, #trim(show_id)#,
> #trim(show_id)#, #trim(show_id)#, #trim(show_id)#, #trim(show_id)#)
> </cfquery>
> I also tried it with
>
> <cfquery name="insert_show_id" datasource="#dsds#" dbtype="ODBC">
> insert
> into HERDING, WORKING, TOY, TERRIER, SPORTING, NON_SPOR, HOUND
> (SHOW_ID)
> values(#trim(show_id)#)
> </cfquery>
>
>
>                                   / \__
> Frederic Valone                  (    @\___
> Webmaster                       /          O
> American Kennel Club           /    (_____/
>                               /_____/     U
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to