home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 416 of 2,288   
   Julia Sats to All   
   one code for two tables   
   17 Sep 03 20:57:12   
   
   From: julia.sats@sympatico.ca   
      
   Can I do something like it:   
      
   if i = 0 then   
         for cur_var in (select * from t0) loop   
   else   
         for cur_var in (select * from t1) loop   
      
   /*   
    a lot of lines here   
   */   
      
   end loop;   
      
      
      
   even if I would try to do like it:   
      
    v_refcursor    refcursor;   
   v_rec0 t0%rowtype;   
   v_rec1 t1%rowtype;   
      
     BEGIN   
   if i = 0 then   
       OPEN v_refcursor FOR     SELECT *     FROM t0   
   else   
       OPEN v_refcursor FOR     SELECT *     FROM t1   
   end if;   
      
   I need to use different record_variables for FETCH and repeat my /* a lot of   
   lines here */ couples time for different record variables.   
      
   Any idea how to do code only once ?   
      
   Thanks   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca