Avatar of maximus1974
maximus1974
 asked on

How to create a procedure in oracle using SQL developer

Need to create a procedure that will perform an update. I attached an example screenshot of what I have attempted with no success. Any help will greatly appreciated.

UPDATE WAREHOUSE_LEVEL SET QTY_MIN = '0', QTY_MAX = '0' WHERE WHS_AUTO_KEY = '31'

Open in new window

Capture.PNG
SQL

Avatar of undefined
Last Comment
Pawan Kumar

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Pawan Kumar

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Pawan Kumar

Sample trial for you

--

CREATE TABLE WAREHOUSE_LEVEL 
(
    ID INT  
  , QTY_MIN VARCHAR2(5)
  , QTY_MAX VARCHAR2(5)
  , WHS_AUTO_KEY VARCHAR2(5)
);

INSERT INTO WAREHOUSE_LEVEL VALUES ( 1,'2','1','31' );

CREATE OR REPLACE Procedure BALOKAD_PROC_WHRSE_MIN_MAX_31
IS
BEGIN
  
   UPDATE WAREHOUSE_LEVEL SET QTY_MIN = '0', QTY_MAX = '0' WHERE WHS_AUTO_KEY = '31';
   COMMIT;
 
END;\\

begin
BALOKAD_PROC_WHRSE_MIN_MAX_31;
end;\\

--

Open in new window


Check the updated Data

--

select * from WAREHOUSE_LEVEL\\


--

Open in new window


OUTPUT

--

/*------------------------
OUTPUT
------------------------*/
ID          QTY_MIN     QTY_MAX     WHS_AUTO_KEY
----------- ----------- ----------- ------------
1           0           0           31

--

Open in new window



Read for more details - https://www.mkyong.com/oracle/oracle-stored-procedure-update-example/
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck