Page 1 of 1

problem using dclgen

PostPosted: Wed Sep 08, 2010 2:44 pm
by swapna namburu
I have 2 tables
dept having deptno, dname in this deptno primary key
emp having eno,ename ,esal,deptno in this eno is primary key and deptno is foreign key references dept(deptno)

using cursor, i want to retrieving all emp columns and dname only.
in cursor
declare c1 cursor
for
select eno,ename,esal,e.deptno , dname from emp e, dept d where e.deptno=d.deptno
but in this case , when we creae dclgen for dept and emp
It creates hv-deptno same name as host variable name for both tables(emp,dept) of deptno
how we represent when we use
fetch c1
into
:hv-eno,
:hv-ename,
:hv-esal,
[color=#000040]:hv-deptno, /* how to mention here this is from emp table*/


:hv-dname

Re: problem using dclgen

PostPosted: Thu Sep 09, 2010 2:41 am
by dick scherrer
Hello and welcome to the forum,

Change the fetch to :dcltablename.hv-deptno to qualify which of the host variables is to be used.

Look at the dclgen to know the actual qualifier for your code.