dcsimg
How to get default length of a column as maximum length of the column datatype?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dattaraj_Joshi
Posted On:   Monday, April 1, 2002 04:30 AM

Hi, When I am fetching the columns using getColumns method of DatabaseMetaData, the method is fetching null for those columns for which the size is not specified. For Example, if a column is defined as create table t1 ( col1 varchar2 ) then the getColumns method is fetching null for col1 size, instead of fetching the maximum size of varchar2 data type(i.e, 4000). Similerly I want to get all the maximum data type sizes for those columns for which the size is not defined. I am connecting to the database using a DSN. This is happening for both Oracle, SQL Server databases. Can any body please help me in this regards?? please mail me or post here. thanks in advance ra   More>>

Hi,
When I am fetching the columns using getColumns method of DatabaseMetaData, the method is fetching null for those columns for which the size is not specified.

For Example, if a column is defined as
create table t1
(
col1 varchar2
)
then the getColumns method is fetching null for col1 size, instead of fetching the maximum size of varchar2 data type(i.e, 4000). Similerly I want to get all the maximum data type sizes for those columns for which the size is not defined.

I am connecting to the database using a DSN. This is happening for both Oracle, SQL Server databases.
Can any body please help me in this regards?? please mail me or post here.

thanks in advance
rajani kanth
rajanikanth@strabus.com

   <<Less

Re: How to get default length of a column as maximum length of the column datatype?

Posted By:   Bozidar_Dangubic  
Posted On:   Monday, April 1, 2002 06:19 AM

I don't think the driver will give you this information. what you could do is store this information as metadata either in some constant class or in a database table. so if you get null for size, check the data type, then check the metadata for the max size on that data type.
About | Sitemap | Contact