Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: ct_describe produces surprising output
Date: Nov 25 1997 4:33PM

Ezra Van Everbroeck wrote:
> Hi,
> I'm trying to use ct_describe to get information about the maximum length of
> (char) fields in a table. The idea is to call the following piece of code
> with the name of the table as the argument ($table).

I thought I had found a bug in the code, so I recoded a quickie
to make sure that I call ct_describe() and don't do anything with 
the returned maxlength. However I still get the same results, and
the pattern I see is that maxlength is really

	max(length($colname)+2, $colsize+1)

so column 'one' has a maxlength of 5, column 'three' has a maxlength
of 7, and column 'six' has a maxlength of 7.

Seems I can't do a whole lot about it right now - although I may
take a couple of minutes to check the docs...

Michael Peppler       -||-  Data Migrations Inc.  -||-