db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre.Tjeldv...@Sun.COM
Subject A question about types
Date Tue, 07 Mar 2006 12:09:02 GMT
While working on DERBY-925 and DERBY-969, I need to get information
about the types of the procedure/function parameters. Specifically I
need to fill the COLUMN_DEF (Default value for the parameter, if any)
and CHAR_OCTET_LENGTH (Byte length of char/binary types, NULL for
other types) columns.

So given type T, how do I

1) Find out if T is character or binary?
2) What the maximum length of T is, if char/binary?
3) If T has a default value?
4) If T's default value is NULL?
5) If T's value cannot be represented without truncation?

>From what I can see, Derby has a number of classes/interfaces that
provides information about types:

org.apache.derby.catalog.TypeDescriptor (interface)
org.apache.derby.catalog.TypeDescriptorImpl (impl)
org.apache.derby.catalog.DataTypeDescriptor (impl)
- getMaximumWidth
- getMaximumWidthInBytes
- getPrecision
- getScale
- isNullable

- getColumnDisplaySize
- getDigitPrecision
- getPrecision
- isNullable

- getApproximateLengthInBytes
- getMaximumMaximumWidth (sic)
- getMaximumPrecision
- getMaximumScale
- isBlobTypeId
- isClobTypeId
- isLobTypeId
- isNumericTypeId

So how can/should I use this to get the information I need? If I need
to add information, where do I add it?



View raw message