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 -> Unable to declare a cursor

Unable to declare a cursor

From: <gordon.t.wu_at_gmail.com>
Date: 30 Jun 2005 11:31:35 -0700
Message-ID: <1120156295.773200.67750@g49g2000cwa.googlegroups.com>


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:31:35 CDT

Original text of this message

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