Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Unable to declare a cursor

Re: Unable to declare a cursor

From: Mike T via DBMonster.com <forum_at_DBMonster.com>
Date: Thu, 30 Jun 2005 18:56:16 GMT
Message-ID: <50A1F97EED2F0@DBMonster.com>


record_id is there twice.

   >SELECT  t.treatment_procedure_id as treatment_procedure_id,
1  >r.record_id as record_id,
   >tr.previous_flag as previous_flag,
   >c.primary_site as primary_site,
2  >r.record_id as record_id,


gordon.t.wu_at_gmail.com wrote:
>Hi, I'm getting a "PLS-00402: alias required in SELECT list of cursor
>to avoid duplicate column names" error when every single one of the
>field in the SELECT clause have been aliased.
>
>CURSOR
>TREATMENT_CUR is
>
>SELECT t.treatment_procedure_id as treatment_procedure_id,
>r.record_id as record_id,
>tr.previous_flag as previous_flag,
>c.primary_site as primary_site,
>r.record_id as record_id,
>r.major_record_subtype as major_record_subtype,
>r.rx_hosp_screen_bx_proc1 as rx_hosp_screen_bx_proc1,
>r.rx_hosp_screen_bx_proc2 as rx_hosp_screen_bx_proc2,
>r.rx_hosp_screen_bx_proc3 as rx_hosp_screen_bx_proc3,
>r.rx_hosp_screen_bx_proc4 as rx_hosp_screen_bx_proc4
>FROM treatment_procedure t JOIN
>treatment_procedure_registry tr ON (t.treatment_procedure_id =
>tr.treatment_procedure_id)
>JOIN
>course cr ON (t.course_id = cr.course_id)
>JOIN
>ctc c ON (c.ctc_id = cr.ctc_id)
>LEFT OUTER JOIN
>record r on (t.record_id = r.record_id)
>WHERE c.date_of_diagnosis_yyyy >= 1998;
>
>Can someone please tell me what did I do wrong to cause the error?
>I'm running Oracle 10g on SLES 9 (service pack 1), if this is relevent
Received on Thu Jun 30 2005 - 13:56:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US