Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Procedure Increace by % Using Criteria

$
0
0
Hoping someone maybe able to assist with this procedure.I am trying to increase the price of an product by a user entered % for items with Dishwasher in the itemdesc.Below is the procedure I have which doesn't appear to show any errors in the SQL Developer.CREATE OR REPLACE PROCEDURE AdjustPrice(pItemDesc IN ITEM.ItemDesc%TYPE,pPercent IN NUMBER) ISBEGINUPDATE ItemSET ItemPrice = ItemPrice + ItemPrice * pPercent / 100WHERE ItemDesc = pItemDesc;END;This is my run script:BEGINAdjustPrice ('%Dishwasher%',10);END;I think the problem is with the way I have done the run script to filter to items with Dishwasher in the description. I tried LIKE an that didn't work either. Any help would be appreciated.Thank you

Viewing all articles
Browse latest Browse all 3145

Trending Articles