Misleading description of SYSCS_DIAG.SPACE_TABLE
------------------------------------------------

                 Key: DERBY-5441
                 URL: https://issues.apache.org/jira/browse/DERBY-5441
             Project: Derby
          Issue Type: Improvement
          Components: Documentation
    Affects Versions: 10.8.1.2
            Reporter: Dag H. Wanvik


This method can take one or two arguments. If two arguments are provided the 
first should be the name of the SCHEMA, the second argument should be the name 
of the TABLE, in both cases in internal normal form, that is, capitalized 
unless the names were created as quoted identifiers.

If the method takes only one argument, that argument should be the name of the 
TABLE. The schema will be taken to be the current default schema

It is somewhat implicit in the docs that the table function can accept one or 
two arguments, I'd like this to be made clearer. In particular, doing something 
like:

     SELECT * from TABLE(SYSCS_DIAG.SPACE_TABLE('APP.FOO')) AS S;

will not give the expected result, since this means the table APP."APP.FOO", 
which is less than obvious.

Also, this sentence of description is wrong, in my view:

    "For example, use the following query to return the space usage for all of 
the user tables and indexes in the database:
    
    SELECT T2.*
        FROM 
            SYS.SYSTABLES systabs,
            TABLE (SYSCS_DIAG.SPACE_TABLE(systabs.tablename)) AS T2
        WHERE systabs.tabletype = 'T'
    
    where T2 is a user-specified table name that is any valid identifier."

Note "all the user tables and indexes in the database". The correct statement 
would be "all the tables and indexes in the current default schema".

If one wanted *all* user tables, the query would be:

    SELECT T2.* 
        FROM
            SYS.SYSTABLES systabs, 
            sys.sysschemas sysschemas, 
            TABLE (SYSCS_DIAG.SPACE_TABLE(sysschemas.schemaname, 
systabs.tablename)) AS T2
            WHERE systabs.tabletype = 'T' and systabs.schemaid = 
sysschemas.schemaid;



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to