SAP Knowledge Base Article - Preview

3551152 - In a query, why tables of the same name but belonging to different owners need aliases when they are fully qualified with their owner names - SAP IQ

Symptom

Consider the scenario below.
2 users own a table of the same name:

create table user1.tab (col_a  int NULL);
create table user2.tab (col_a  int NULL); 

In this query below, both tables are full qualified with owner.table_name.column_name.

SELECT * FROM user1.tab JOIN user2.tab ON user1.tab.col_a = user2.tab.col_a

This error is fired:

Could not execute statement. More than one table is identified as 'tab'
SQLCODE=-139, ODBC 3 State="42000"

 

If an alias name for each table is specified, then the query succeeds.

SELECT * FROM user1.tab u1_t JOIN user2.tab u2_t ON u1_t.col_a = u2_t.col_a

Why is an alias name necessary for the tables in this scenario, while the tables are fully qualified with their owner names?


Read more...

Environment

SAP IQ 16.1

Product

SAP IQ 16.1

Keywords

"correlation name"; "table alias"; alias , KBA , BC-SYB-IQ , Sybase IQ , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.