Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inserting even numbers by procedure HELP

xiobijaphJan 21 2019 — edited Jan 21 2019

Hi,
I would like to insert even numbers by procedure in compartment 1 to 100.

I tried but it doesn't work:

CREATE TABLE numbers(number INT);

/

SET SERVEROUTPUT ON

/

CREATE OR REPLACE PROCEDURE insert_even IS

p_od NUMBER:=1;

p_do NUMBER:=100;

BEGIN

LOOP

p_od:=p_od+1;

IF mod(number,2)=0

then

INSERT INTO numbers values(number);

exit when p_od=p_do;

end if;

end loop;

end;

Thanks for advance

This post has been answered by Saubhik on Jan 21 2019
Jump to Answer

Comments

User_CVZLU
Answer

Problem solved. It was another application which caused the problem. Now working on that one.

Marked as Answer by User_CVZLU · Mar 21 2021
1 - 1

Post Details

Added on Jan 21 2019
16 comments
572 views