Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table Alias

Former Member
0 Likes
681

Hello

I need to access twice the same table with the help of aliases.

I tried this

SELECT DISTINCT CHILD~NODENAME PARENT~NODENAME into table it_org_hierarki FROM /BI0/HORGUNIT AS CHILD
      JOIN /BI0/HORGUNIT AS PARENT ON PARENT~NODEID = CHILD~PARENTID.

But I get an run-time error DBIF_RSQL_INVALID_RSQL.

How can I get what I'm looking for ? Isn't it possible to use an alias to access the same table twice in a SELECT?

4 REPLIES 4
Read only

Former Member
0 Likes
612

Ignore

Edited by: Nitwick on Dec 16, 2009 4:41 PM

Read only

Former Member
0 Likes
612

Hi,

I think you are getting this error coz the internal table is over filled.


SELECT DISTINCT CHILD~NODENAME PARENT~NODENAME into table it_org_hierarki FROM /BI0/HORGUNIT AS CHILD
      JOIN /BI0/HORGUNIT AS PARENT ON PARENT~NODEID = CHILD~PARENTID.  "Use the WHERE clause and fetch only the records that you want

Read only

Former Member
0 Likes
612

It's ok now.

I simply had a bad definition in my internal table. It didn't match with the 2 selected fields .

Sorry.

Read only

0 Likes
612

did you manage to solve this, I'm trying to read the orgunit hierarchy table to find all the child nodes under each parent orgunit, can some one guide me please?