Home » SQL & PL/SQL » SQL & PL/SQL » VIEW
VIEW [message #223666] Sat, 10 March 2007 03:38 Go to next message
getritesh
Messages: 235
Registered: July 2006
Location: INDIA
Senior Member

I created a View

CREATE OR REPLACE VIEW VR(NAME,VDATE)
AS
SELECT ENAME,HIREDATE FROM EMP

View created.


Then I issued

SQL> UPDATE VR
SET NAME = 'RAM'
WHERE TO_CHAR(VDATE,'DD-MON-YY') = '23-JAN-82';

1 row updated.

SQL> INSERT INTO VR VALUES('RITESH','01-FEB-2001');

1 row created.

SQL> DELETE * FROM VR WHERE ENAME LIKE 'SMITH';
DELETE * FROM VR WHERE ENAME LIKE 'SMITH'
*
ERROR at line 1:
ORA-00903: invalid table name

Why deletion failed ,I want ur help for this.
Re: VIEW [message #223667 is a reply to message #223666] Sat, 10 March 2007 03:42 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

Quote:
SQL> DELETE * FROM VR WHERE ENAME LIKE 'SMITH';
DELETE * FROM VR WHERE ENAME LIKE 'SMITH'
*
ERROR at line 1:
ORA-00903: invalid table name

Why deletion failed ,I want ur help for this.



the corret syntax for delete is

delete from table_name where [where_condition]

regards,

[Updated on: Sat, 10 March 2007 03:43]

Report message to a moderator

Re: VIEW [message #223668 is a reply to message #223666] Sat, 10 March 2007 03:46 Go to previous message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
Because, according to the DELETE syntax, "*" is expected to be a table name.

Before posting such questions, please consult SQL Reference.
Previous Topic: PROBLEM WITH LEFT OUTER JOIN
Next Topic: TABLE ACCESS FULL
Goto Forum:
  


Current Time: Mon Dec 05 02:52:51 CST 2016

Total time taken to generate the page: 0.25248 seconds