Home » SQL & PL/SQL » SQL & PL/SQL » getting the values from a cursor on different tables
getting the values from a cursor on different tables [message #248391] Thu, 28 June 2007 19:22 Go to next message
srhngsn
Messages: 6
Registered: June 2007
Junior Member
Hi,

I woul like to know how to refer to the values in a cursor in the following situation :


 CURSOR curs IS
 select type_emplacement, s.id_emplacement, montant_facture, date_fin, date_debut 
 from sejour s, type t, facture f, emplacement e 
 where s.id_estivant = vacancier 
 and s.id_facture = f.id_facture 
 and s.ID_EMPLACEMENT = e.id_emplacement 
 and e.ID_CODE_EMPLACEMENT = t.ID_CODE_EMPLACEMENT;



id_emplacement is in both "sejour" and "emplacement" so I have to distinguish between them. After that I can't seem to find the right way to call the value. I have tried using using the whole chain then aliases in every way like :

(s.id_emplacement) as place

or

(s.id_emplacement)place

then:

 FOR rec IN curs LOOP
    dbms_output.put_line(res.place);


but it doesn't work

Oracle 10.2.0


Thanks
Re: getting the values from a cursor on different tables [message #248392 is a reply to message #248391] Thu, 28 June 2007 19:32 Go to previous message
srhngsn
Messages: 6
Registered: June 2007
Junior Member
Nevermind, I had a typo that I totally missed for the last half-hour Embarassed
Previous Topic: Does this exist in sql
Next Topic: How to swap two rows ina table without creating any temporary storage?
Goto Forum:
  


Current Time: Mon Dec 05 05:07:09 CST 2016

Total time taken to generate the page: 0.06136 seconds