Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Learning and need some syntax help

Status
Not open for further replies.

DougDown

IS-IT--Management
Sep 21, 2000
2
US
I am trying to learn and am having a syntax problem in the following statement:

INSERT INTO * "EMP EMP_No,Password,Email"
VALUES ('::EMP_No::', '::password::','::Email::')

The error is pointing to the ' after the ( in the VALUES line.

Can anyone help me out with the correct syntax and an explanation?

Thanks [sig][/sig]
 
I am not sure what flavor of SQL you are using, but in Oracle the basic structure of an INSERT statement is:
Code:
INSERT INTO tablename (charfld, numberfld, datefld)
VALUES ('value', 100, '21-SEP-00');
Hope this helps...
[sig]<p>Terry M. Hoey<br><a href=mailto:th3856@txmail.sbc.com>th3856@txmail.sbc.com</a><br><a href= > </a><br>Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?[/sig]
 
Your values only need to be in quotes '......' if they're not ints (i seeem to remember). Its a bit tricky from what you've written. SQL is standard. Oracle have provided extra functionality, but you're not interested in this. This should work in any circumstance &quot;INSERT INTO tablename (columnname, columnname, columnname) VALUES (1,2,3). So, INSERT INTO EMP(emp_no,password,email) VALUES (1234,'asdfg','as@as') emp_no has, here, been defined as an int, and doesn't have quotes. ps MYSQL doesn't deferentiate between &quot; and ' [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top