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
Mike T - 30 Jun 2005 19:56 GMT
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,
>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
[quoted text clipped - 26 lines]
>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
gordon.t.wu@gmail.com - 30 Jun 2005 20:04 GMT
OMG, I can't believe I'm such an ...
Maxim Demenko - 30 Jun 2005 20:05 GMT
gordon.t.wu@gmail.com schrieb:
> 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
[quoted text clipped - 26 lines]
> 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
You have twice the r.record_id ( with the same alias ) in your select
list, so ,i assume, if you reference that column, the error occurs.
Best regards
Maxim