Randy Gilman
Randy Gilman

Reputation: 457

Update Statement not updating properly

My create customer table is as follows:

CREATE TABLE customers 
(
   customer_id NUMBER(5),
   store_id NUMBER(4),
   firstname VARCHAR2(20),
   lastname VARCHAR2(20),
   gender CHAR(1),
   street VARCHAR2(50),
   city VARCHAR2(20),
   state VARCHAR2(15),
   zip_code VARCHAR2(10),
   card_approved CHAR(1),
   card_approved_date DATE,
   phone_number VARCHAR2(10),
   card_number NUMBER(10),
   rent_limit NUMBER(2),
   overdue_notified CHAR(1),

   CONSTRAINT customers_pk PRIMARY KEY(customer_id),
   CONSTRAINT customers_fk 
      FOREIGN KEY(store_id) REFERENCES movie_rental_stores(store_id)
);

My data for the tuple I am trying to update is as follows:

VALUES('00005', '001', 'Aspen', 'Lily', 'F', '267 Lesperance', 'Dallas', 'TX', '34567', 'Y', '05-SEP-2014', '2569842356', '1236395891', '5', 'N');

The Update statement looks like this:

UPDATE customers
SET lastname = 'Burtner',
WHERE customer_id = '00005';

However, when I execute it I keep getting the following error:

ORA-01747: invalid user.table.column, table.column, or column specification

I tried removing quotes from customer_id, and every scenario I could think of but it won't let me update it.

Upvotes: 0

Views: 49

Answers (2)

Alex
Alex

Reputation: 371

Undo the comma after 'burtner'

i think this might be the problem

Upvotes: 0

Siyual
Siyual

Reputation: 16917

You have a trailing comma in your update statement

UPDATE customers
SET lastname='Burtner',  <-- here
WHERE customer_id='00005';

Change it to this:

UPDATE customers
SET lastname='Burtner'
WHERE customer_id='00005';

Upvotes: 3

Related Questions