Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-03-23
8
Medium Priority
?
808 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
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 …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

597 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