Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00933: SQL command not properly ended (Oracle Live SQL)
ORA-00933: SQL command not properly ended [message #675943] Wed, 01 May 2019 08:13 Go to next message
davethewelder
Messages: 3
Registered: May 2019
Junior Member
Hi, just relearning sql and trying to update the First name, last name in the employees table but getting the error "ORA-00933: SQL command not properly ended" . Code below.
INSERT INTO employees (First_Name, Last_Name) VALUES
('Louise', 'Popp')
Where employee_id = '1';

I am stumped as to why. Can anyone explain my mistake?
Davie
Re: ORA-00933: SQL command not properly ended [message #675945 is a reply to message #675943] Wed, 01 May 2019 08:16 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read the OraFAQ Forum Guide and How to use code tags and make your code easier to read

An INSERT statement cannot include WHERE. THere is no row to which the predicate could be applied.
Re: ORA-00933: SQL command not properly ended [message #675946 is a reply to message #675943] Wed, 01 May 2019 08:17 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
davethewelder wrote on Wed, 01 May 2019 06:13
Hi, just relearning sql and trying to update the First name, last name in the employees table but getting the error "ORA-00933: SQL command not properly ended" . Code below.
INSERT INTO employees (First_Name, Last_Name) VALUES
('Louise', 'Popp')
Where employee_id = '1';

I am stumped as to why. Can anyone explain my mistake?
Davie

INSERT statement contains no WHERE clause
INSERT statement adds new rows to table.
To change existing row values you must use UPDATE statement
Re: ORA-00933: SQL command not properly ended [message #675947 is a reply to message #675946] Wed, 01 May 2019 08:47 Go to previous messageGo to next message
davethewelder
Messages: 3
Registered: May 2019
Junior Member
Hi again, when I log into live sql i have to create the tables and populate them. I have the script to create the table which works but when I try to populate the employees table I get the "ORA-01438: value larger than specified precision allowed for this column ORA-06512: at "SYS.DBMS_SQL", line 1721" error message. The table structure and code are

Columns
# Column Type Length Precision Scale Nullable Semantics Comment
1 EMPLOYEE_ID NUMBER 22 2 0 No
2 FIRST_NAME VARCHAR2 14 Yes Byte
3 LAST_NAME VARCHAR2 13 Yes Byte
4 EMAIL VARCHAR2 25 Yes Byte
5 PHONE_NUMBER VARCHAR2 25 Yes Byte
6 HIRE_DATE DATE 7 Yes
7 JOB_ID VARCHAR2 10 Yes Byte
8 SALARY NUMBER 22 8 2 Yes
9 COMMISION_PCT NUMBER 22 2 2 Yes
10 MANAGER_ID NUMBER 22 6 0 Yes
11 DEPARTMENT_ID NUMBER 22 4 0 Yes
INSERT INTO employees VALUES
( 101
, 'Neena'
, 'Kochhar'
, 'NKOCHHAR'
, '515.123.4568'
, TO_DATE('21-SEP-1989', 'dd-MON-yyyy')
, 'AD_VP'
, 17000
, NULL
, 100
, 90)
yet again I cannot find the error.
Re: ORA-00933: SQL command not properly ended [message #675948 is a reply to message #675947] Wed, 01 May 2019 08:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read


Please post CREATE TABLE EMPLOYEES statement in full.
Re: ORA-00933: SQL command not properly ended [message #675949 is a reply to message #675947] Wed, 01 May 2019 08:56 Go to previous messageGo to next message
davethewelder
Messages: 3
Registered: May 2019
Junior Member
Just figured the problem out. Employee_id is number (2) length and I was trying to input 3 chars. Thanks for your help.
Re: ORA-00933: SQL command not properly ended [message #675950 is a reply to message #675949] Wed, 01 May 2019 09:27 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
BTW, questions similar to this one can be submitted to the SQL & PL/SQL subforum at the top of the "home" page.
Re: ORA-00933: SQL command not properly ended [message #675970 is a reply to message #675950] Thu, 02 May 2019 08:43 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
and when your employee number goes to 4 digits your table blows out again. don't shortchange an id field. for something like this I would use number(15)
Re: ORA-00933: SQL command not properly ended [message #675971 is a reply to message #675970] Thu, 02 May 2019 09:54 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'd just use number - max length.
Previous Topic: Runtime data stored in tables
Next Topic: parent value of xmlquery
Goto Forum:
  


Current Time: Thu Mar 28 12:20:01 CDT 2024