Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: ct_describe produces surprising output
Date: Nov 25 1997 10:04PM
Ezra Van Everbroeck wrote:
> On Tue, 25 Nov 1997, Craig Jackson wrote:
> > > max(length($colname)+2, $colsize+1)
> > Looks like it's actually defined as "The number of characters ISQL should
> > reserve for printing this column"
> Thanks a lot for the information. Is there some other way in which I can
> find out the maximum number of characters that can be put in a field? I want
> to use those values to automatically limit the length of input boxes on a
> web form - so, without having to hardcode these values into the program.
You can query the system tables.
my $ret = $dbh->ct_sql("
select c.name, t.name, c.length, c.prec, c.scale,
identity = convert(bit, (c.status & 0x80))
from $physdb.dbo.syscolumns c, $physdb.dbo.systypes t
where c.id = object_id('$physdb.dbo.$table')
and c.usertype *= t.usertype");
should give you all the info you need.
Michael Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler