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
maximus1974Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
Loop is not required in there. Please try like this -

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;

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Pawan KumarDatabase ExpertCommented:
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/
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.