Ellis Jordan
Ellis Jordan

Reputation: 47

ORA-00936: missing expression for DELETE statement & VIEW in Oracle 11g

I am getting the message "ORA-00936: missing expression" when I am trying to create a DELETE statement and a VIEW in Oracle 11g.

DELETE STATEMENT: Here's the original table created:

    CREATE TABLE SHIPMENT
    (
    ShipmentID INT PRIMARY KEY,
    ShipperID INT NOT NULL REFERENCES SHIPPER(ShipperID),
    ShipperInvoiceNumber INT NOT NULL UNIQUE,
    Origin VARCHAR2(30) NOT NULL,
    Destination VARCHAR2(30) NOT NULL,
    DepartureDate DATE,
    ArrivalDate DATE
    );  

And here's the DELETE statement I want to use:

    DELETE SHIPMENT WHERE ShipmentID = <ShipmentID TO DELETE>;

VIEW: Here's the view I want to create:

    CREATE VIEW PurchaseSummaryView AS
    SELECT PurchaseID, [Date], Description, AND PriceUSD
    FROM PURCHASE_ITEM;​

And this is the table created for it:

    CREATE TABLE PURCHASE_ITEM
    (
    PurchaseItemID INT PRIMARY KEY,
    StoreID INT NOT NULL REFERENCES STORE(StoreID),
    "Date" DATE NOT NULL,
    Description VARCHAR2(30) NOT NULL,
    Category VARCHAR2(30),
    PriceUsed NUMBER(15, 2)
    );

I am not familiar with Oracle 11g as I want to be. What simple mistake am I making?

Upvotes: 0

Views: 455

Answers (1)

psaraj12
psaraj12

Reputation: 5072

Please create the view like below

 CREATE OR REPLACE  VIEW PurchaseSummaryView AS
 SELECT PurchaseID, "Date", Description, PriceUSD
 FROM PURCHASE_ITEM;​

And delete the statement should be fine

Upvotes: 1

Related Questions