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: Craig Jackson <CRAIGJ at epub dot med dot iacnet dot com>
Subject: Re: ct_describe produces surprising output
Date: Nov 25 1997 5:00PM

>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.

Looks like it's actually defined as "The number of characters ISQL should
reserve for printing this column"

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

Craig Jackson
Electronic Publishing,
Information Access Company