Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to declare cursor ?
Good practice is to ask for the columns you want explicitly. It will save
you many bugs and headaches later. But if you insist then
select e.*,d.* from dept d, employee e where d.dept_no=e.dept_no;
Bad practice.
Jim
"dragon ball" <perseus_medusa_at_hotmail.com> wrote in message
news:3d422d17$1_at_newsgate.hknet.com...
> Hi all , I am learning to write PL/SQL and when I declare the following :
>
> CURSOR foo_cur IS
> SELECT * FROM DEPT, EMPLOYEE
> WHERE DEPT.dept_no = EMPLOYEE.dept_no
>
> the compiler complain me of duplicating column ( I guess is the confused
> dept_no between two table) . So is there anyway shorter to declare all the
> column in dept and employee without writing explicitly each column ? Since
I
> think the list will be very very long if the joining involve several
tables
> and I require all columns.
>
> Thanks
>
> Perseus
>
>
Received on Sat Jul 27 2002 - 00:42:08 CDT