Thanks to all that helped, turns out "value" is a reserved word.(duh)

Luckily, the escape technique is the same as ms sql server.  Here's the
query that worked:

INSERT INTO tbOptions (tbQuestionsFK, [Value], supplementalValue1,
supplementalValue2)
SELECT 20 AS tbQuestionsFK, tbContentClassifications.id,
tbContentClassifications.name, tbContentClassifications.description
FROM tbContentClassifications
where tbContentClassifications.tablePK >= 5
AND tbContentClassifications.tablePK <=23


(the alias worked ok)

Thanks again to all!

Matthew P. Smith 
Web Developer, Object Oriented 
Naval Education & Training Professional 
Development & Technology Center 
(NETPDTC) 
(850)452-1001 ext. 1245 
[EMAIL PROTECTED] 


-----Original Message-----
From: Scott Weikert [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 09, 2003 4:12 PM
To: SQL
Subject: RE: access insert select not working

At 03:51 PM 1/9/2003 -0600, you wrote:
>INSERT INTO tbOptions (tbQuestionsFK, Value, supplementalValue1,
>supplementalValue2)
>SELECT 20 AS tbQuestionsFK, tbContentClassifications.id,
>tbContentClassifications.name, tbContentClassifications.description
>FROM tbContentClassifications
>where tbContentClassifications.tablePK >= 5
>AND tbContentClassifications.tablePK <=23
>
>"syntax error in INSERT INTO statement"
>
>tried it, but I still had that extra column on there before, took it off
and
>still errors.  Have also tried a semicolon at the end of the statement.


I was going to say, you had different numbers of columns there, but you 
seem to have fixed it...

Oh I think I see it now. Ditch the "as tbQuestionsFK" in the SELECT. You're 
wanting to put the value '20' in all your inserted rows, right? You don't 
need to refer to it with an 'as (fieldname)'.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                        

Reply via email to