db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A B (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1094) Make DatabaseMetaData.getProcedureColumns() JDBC4 compliant
Date Mon, 20 Mar 2006 15:51:58 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1094?page=comments#action_12371102 ] 

A B commented on DERBY-1094:
----------------------------

> I have come to the conclusion that neither the ODBC nor the JDBC query is correct. 

I think the radix is "2" for ODBC metadata because we're returning ODBC 3.0 result sets and
there is the following paragraph from the ODBC API site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcdatetime_data_types.asp

<begin quote>

An ODBC 3.x driver processes the function calls listed in the previous paragraph according
to the setting of the SQL_ATTR_ODBC_VERSION environment attribute. For SQLColumns, SQLGetTypeInfo,
SQLProcedureColumns, SQLSpecialColumns, and SQLStatistics, if SQL_ATTR_ODBC_VERSION is set
to SQL_OV_ODBC3, the functions return SQL_TYPE_DATE, SQL_TYPE_TIME, and SQL_TYPE_TIMESTAMP
in the DATA_TYPE field. The COLUMN_SIZE column (in the result set returned by SQLColumns,
SQLGetTypeInfo, SQLProcedureColumns, and SQLSpecialColumns) contains the binary precision
for the approximate numeric type. The NUM_PREC_RADIX column (in the result set returned by
SQLColumns, SQLGetTypeInfo, and SQLProcedureColumns) contains a value of 2. If SQL_ATTR_ODBC_VERSION
is set to SQL_OV_ODBC2, then the functions return SQL_DATE, SQL_TIME, and SQL_TIMESTAMP in
the DATA_TYPE field, the COLUMN_SIZE column contains the decimal precision for the approximate
numeric type, and the NUM_PREC_RADIX column contains a value
  of 10.

<end quote>

So since we're (attempting to) return ODBC 3 result sets, radix should be 2 for date, time,
and timestamp.

> SCALE/DECIMAL_DIGITS should be null for DATE, and a non-zero, non-negative number 
> equal to the number of digits to the right of the the decimal point (fractional seconds)
for
> TIME and TIMESTAMP. 

This agrees with the ODBC values you give above, with the exception of "non-zero".  Why does
decimal_digits have to be non-zero for time?  The site that you point to says the following:

<begin quote>

The number of digits to the right of the decimal point in the seconds part of the value (fractional
seconds). This number cannot be negative.

<end quote>

I.e. it must be non-negative, but I don't see anything about non-zero...Or am I just overlooking
it?

> Make DatabaseMetaData.getProcedureColumns() JDBC4 compliant
> -----------------------------------------------------------
>
>          Key: DERBY-1094
>          URL: http://issues.apache.org/jira/browse/DERBY-1094
>      Project: Derby
>         Type: Sub-task
>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Dyre Tjeldvoll
>     Assignee: Dyre Tjeldvoll
>      Fix For: 10.2.0.0
>  Attachments: derby-1094.preliminary.diff
>
> The result set returned by getProcedureColumns() must be extended with 7 additional columns
in JDBC 4.0; COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION,
IS_NULLABLE and SPECIFIC_NAME. The returned result set should be ordered by PROCEDURE_SCHEMA,
PROCEDURE_NAME and SPECIFIC_NAME

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message