?
Solved

URGENT: Missing semicolon (;) at end of SQL statement.

Posted on 2004-03-23
8
Medium Priority
?
806 Views
Last Modified: 2007-12-19
Hey Experts,

I have a table with the fields: id and idCustomer
An insert into this table ( nnOrder ) fails

insert into nnOrder (idCustomer) values (6) where id = 68

Error message is
Missing semicolon (;) at end of SQL statement.

what's the problem?

TIA
0
Comment
Question by:denam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10663263
have yoou tried this:

insert into nnOrder (idCustomer) values (6) where id = 68;

cheers
0
 
LVL 1

Author Comment

by:denam
ID: 10663274
yes...of course.  i still get the same error
0
 
LVL 16

Accepted Solution

by:
ahmedbahgat earned 500 total points
ID: 10663282
the proper syntex should be

INSERT INTO nnOrder ( idCustomer ) SELECT 6 AS Exp FROM nnOrder WHERE (((nnOrder .ID)=68));

cheers
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:denam
ID: 10663313
your example worked where my query failed.
but I don't understand why.  I use mssql mostly.
this is the way i write an insert in tsql for mssql.

why does it fail in access?

Thanks!
0
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10663331
Each database engine, will use its own SQL language and because SQL lanugage is a standard technology, you will see that most of the statement are valid in all, like SELECT, INSERT INTO, however the whole SQL statment "after being composed" will be different from one platform to another


the way I write SQL under access, is to use the GUI then view the SQL equivelent from the menu bar, then copy it and this is how I got my answer from


cheers
0
 
LVL 1

Author Comment

by:denam
ID: 10663353
Thanks Ahmed.  Is there anyplace (link) where I could
read more about this?
0
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10663382
not really the way I discivered access sql statement is by creating any query I want "whatever comlicated it is" by using ACCESS GUI query builder, then from <View> menu bar I select <SQL View> and this will convert the GUI to the proper access sql equivlent

the more you do it the more you learn about it and how access deals with SQL statement

cheers
0
 
LVL 1

Author Comment

by:denam
ID: 10663393
That works.  Thanks so much!
0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question