By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,590 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,590 IT Pros & Developers. It's quick & easy.

describe table ignores alias ?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.