470,867 Members | 1,799 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,867 developers. It's quick & easy.

describe table ignores alias ?

Environment UDB 8.1 Fixpak 9 on Solaris (64bit instance).

After connecting to the database as "my_user".

There is an alias from my_user.mytable to XXX.mytable.
There is no real table my_user.mytable, only an alias.

"select count(*) from mytable" gives correct result for unqualified
table name.

"describe table my_table" gives SQLCODE 100.

But "describe table XXX.my_table" gives correct result.

Also: if I first issue "SET SCHEMA XXX" before
performing the unqualified DESCRIBE TABLE, then it works OK.

So "describe table" does not work for aliases, I'm just wondering why
that might be - seems a bit restrictive.

Nov 12 '05 #1
2 2180
In DESCRIBE section in "DB2 UDB Command Reference", followings were
described:
TABLE table-name
Specifies the table or view to be described. The fully qualified name
in the form schema.table-name must be used. An alias for the table
cannot be used in place of the actual table. The schema is the user
name under which the table or view was created.

Nov 12 '05 #2
Tonkuma wrote:
In DESCRIBE section in "DB2 UDB Command Reference", followings were
described:
TABLE table-name
Specifies the table or view to be described. The fully qualified name
in the form schema.table-name must be used. An alias for the table
cannot be used in place of the actual table. The schema is the user
name under which the table or view was created.

I can resist a good opportunity to peddle FP9:
http://publib.boulder.ibm.com/infoce...n/r0012547.htm

CALL SYSPROC.ADMIN_CMD('describe select * from org')

9 Result set 1
9 --------------
9
9 SQLTYPE SQLLENGTH SQLSCALE SQLNAME_DATA SQLNAME_LENGTH
9 ...--------...--------- -------- ------------...--------------...
9 SMALLINT 2 0 DEPTNUMB 8
9 VARCHAR 14 0 DEPTNAME 8
9 SMALLINT 2 0 MANAGER 7
9 VARCHAR 10 0 DIVISION 8
9 VARCHAR 13 0 LOCATION 8
9
9 5 record(s) selected.
9
9 Return Status = 0

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Perre Van Wilrijk | last post: by
1 post views Thread by Girish | last post: by
1 post views Thread by BARTKO, Zoltan | last post: by
reply views Thread by atulmanvar | last post: by
3 posts views Thread by Rodríguez Rodríguez, Pere | last post: by
4 posts views Thread by Paul | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.