My task is to write a procedure which has to get information about price of a product and
updates the data base for produc_id=777.
if product_pirce < 400
if product_price > 400
create or replace procedure change_price is begin if (select price from product where produc_id=777) <400 then update product set price=500 where produc_id=777; end if; if (select price from product where produc_id=777) > 400 then update product set price=300 where produc_id=777; end if; end change_price;
Encountered the symbol "SELECT" when expecting one of the following:
( - + case mod new not null others
Can some one show my how should my procedure be written if I want to get data using SELECT ?
maby sholud I create a cursor ?
As you see
- it needs to get information from tables (SELECT something)
- it needs to work witch that information (if>?)
Thanks for any help.