I have one stored procedure to be able to execute using execute rather than
select in PowerBuilder. It isn't big issue but why ?
There is stored procedure to summarize data
sp_sum()
select parts,wh1,wh2,iqty,sum(qty) bal from instruction,stock group by parts,wh1,wh2,iqty having bal >=iqty

2nd stored procedure refer to 1st stored procedure
sp_instruction()
select * from instruction a,sp_sum() b where
a.parts=b.parts and a.wh1=b.wh1 and a.wh2=b.wh2 and a.iqty=b.iqty

as you can see, since I use * in sp_instruction, it appear same column name
from different tables.

Question is

If I execute from Development tools (like powerbuilder)
I can execute sp_instruction()-> execute sp_instruction()
but
select * from sp_instruction();
complain about name of column parts found in more than one table -- need
correlation name

I understand the reason why, but I don't understand why execute sp_instruction() can work ?
also following sql don't complain to execute from development tool
select * from instruction a,sp_sum() b where
a.parts=b.parts and a.wh1=b.wh1 and a.wh2=b.wh2 and a.iqty=b.iqty