SQL Update/Insert Reserved Words
SQL Update/Insert Reserved Words
(OP)
Having a problem with UPDATE and INSERT command.
Have database with fields named ID, Serial, By, Date
SQL Update Command:
UPDATE Transactions SET Serial="1234",By="Lee",Date="11/01/2009" WHERE ID=2101
Command fails due to improper syntax.
Traced it to fields "BY" and "DATE"
If I modify Database field Names to "sBY" and "sDATE" and change SQL accordingly it works fine.
Is there a way to use BY and DATE as field names?
Any help would be appreciated.
Lee
Have database with fields named ID, Serial, By, Date
SQL Update Command:
UPDATE Transactions SET Serial="1234",By="Lee",Date="11/01/2009" WHERE ID=2101
Command fails due to improper syntax.
Traced it to fields "BY" and "DATE"
If I modify Database field Names to "sBY" and "sDATE" and change SQL accordingly it works fine.
Is there a way to use BY and DATE as field names?
Any help would be appreciated.
Lee
RE: SQL Update/Insert Reserved Words
fieldcolumn namessince you posted in the ANSI SQL forum, here's the ANSI SQL answer --
"BY" and "DATE"
this may or may not work in your particular database system
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
RE: SQL Update/Insert Reserved Words
Thanks for pointing me in right direction.
Lee