I have a region in oracle apex to which the data is getting from an pl/sql.
The following is the pl/sql source:

begin for drow in ( select * from books where book_id = :P13_BooK_ID ) loop htp.prn('
Reporting Period ' || to_char(drow.REPORTING_PERIOD, 'MM-DD-YYYY') || '
L Key ' || drow.L_KEY || '
Name ' || drow.BooK_NAME || '
C Type ' || drow.C_TYPE || '
E Count ' || drow.E_COUNT || '
'); end loop;end;/Now I would like to add two more details(principal,director) into this region which are in another table called school and I have a common column in these two tables books,school as books.l_key = school.k_key.
How can I add these two details in the above region and there are many common column names in both the tables so when I tried as:

for drow in ( select * from books b, school s where book_id = :P13_BooK_ID and books.l_key =school.k_key) loopit shows me error
ORA-06550: line 4, column 2: PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names ORA-06550: line 4, column 2: PL/SQL: Statement ignored
can someone tell me how can I get these two details to add in the region. Thanks


Check Solution