Results 1 to 3 of 3

Thread: Store Value using loop in procedure

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Answers
    2

    Store Value using loop in procedure

    Please tell me the full query in which we create a procedure and store 20 values in a Table using that procedure using loop.

    Thnx


  2. #2
    Contributing Member
    Join Date
    Jan 2007
    Answers
    33

    Re: Store Value using loop in procedure

    Hi Talha,

    i think you want to insert values in a table with ease.....
    it is difficult for me to understand your question
    please elaborate more....


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Store Value using loop in procedure

    Try using the forall inside a procedure.
    Sample code
    Code:
     
    declare 
    type mytype is varray(3) of number(5); 
    type dn is varray(3) of varchar2(10); 
    type lc is varray(3) of varchar2(10); 
    no mytype :=mytype(); 
    de dn:=dn(); 
    lo lc:=lc(); 
    begin 
    no:=mytype(1,2,3); 
    de:=dn('a','b','c'); 
    lo:=lc('ab','bc','cd'); 
    forall i in 1..3 
    insert into dept values(no(i),de(i),lo(i)); 
    end;



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact