1. Re: ODBC.e : Char Type Column in a Cursor with length 50

Rad wrote:
> 
> Hi,
> 
> I am using odbc.e 1.34 with MySQL 5.x database on WinXP Pro (SP2).
> 
> In a table, I have a column of type "char" with length 150.
> I can access the entire value of this column correctly using normal select
> clause.
> 
> But if I create a Cursor for the same table, only first 49 characters of the
> value in this column are returned correctly, everything else is junk
> characters.
> I tried to change the column type to "varchar", but still got the same result.
> 
> Are there any restrictions on length of character column of cursor in odbc.e?
> How to get the entire available value of char column with length greater than
> 50 from a cursor?

Erm.  Yeah, apparently it's my fault.  If you look at createCursor in
odbc.e, and at (in my local copy, at least) line 2331:
handle_cols[hstmt][i] &= 50

I suspect that I just threw that in there when I was first writing this
stuff, and figured I'd come back later and fix the length later (at least,
I *hope* that's what I was thinking).  

I suspect (it's been a while since I've worked on this code) that the 
actual size information could be retrieved from within getColumnHeaders(),
though I'm not sure ATM what the right was to do this would be.

Your best (short term) course of action is probably to just change the 
hard coded value.  Your best long term approach is probably to fix my
code and send me a patch. :)

In the meantime, I've noted the bug, and added it to my TODO list.

Matt

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu