Skip to Content.
Sympa Menu

freetds - Re: [freetds] maxlength of CS_TEXT_TYPE - 2GB?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Erik Bryn <erik.bryn AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] maxlength of CS_TEXT_TYPE - 2GB?
  • Date: Sun, 22 Aug 2010 09:02:02 -0700

When setting up binds, I'm not aware how it would be possible to know
the length of the data yet to have been fetched. AFAIK, from the
examples I've seen, you need to use the CS_DATAFMT information
provided by ct_describe.

Since my initial email, I've found the cs_get_data function, but it's
limitations of being used only on unbound columns, which cannot be
proceeded by bound columns pretty much eliminates it as an option.

Thanks for the help,
- Erik

On Sun, Aug 22, 2010 at 6:31 AM, Frediano Ziglio <freddy77 AT gmail.com> wrote:
> Il giorno 22/ago/2010, alle ore 07.59, Erik Bryn <erik.bryn AT gmail.com> ha
> scritto:
>
>> Hi,
>>
>> I'm new to interfacing with FreeTDS in C. While attempting to fetch
>> text, using ct-lib, from MSSQL 2008. I'm seeing the maxlength of the
>> field is 2GB, which is obviously too large to malloc. What's the best
>> practice for reading in data of unknown length?
>>
>> Thanks,
>> - Erik
>
> Well, use lenght instead of maxlenght and allocate as long as you need
>
> Freddy77
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




Archive powered by MHonArc 2.6.24.

Top of Page