Garayed.com  

Go Back   Garayed.com > PHP
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-2007, 07:46 AM
Humppatirallaa
 
Posts: n/a
Default PHP, MS SQL, OBDC and variable length columns

So, the problem is that I query data out of a ntext (variable length
Unicode text) field, and it is corrupted near the end.

Yes, I know that the misfeatures odbc.defaultlrl and
odbc_longreadlen() exist, but what good are they if I don't know the
data size beforehand? No, setting it to a very high value is not
acceptable - it noticeably slows PHP down (as it is allocating the
large buffer) and still poses a limit which can be broken. No, I'm not
going to add an extra 'length' column to the tables just because PHP/
ODBC is being stupid, that's just a silly workaround.

Yes, I could datalength(column), but why should I have to write silly
workarounds and break my serialization scheme and database classes and
everything _and_ generate unnecessary queries on the database just to
get data out of it?

Yes, I've installed the latest MDAC. Yes, I could use extensions
providing native access to the database, but I _have_ to get ODBC
working as well. I read on some site that calling odbc_result()
multiple times on the cell will fill the buffer in chunks allowing one
to ultimately retrieve all the data, but it doesn't seem to work here.
Undocumented behaviour that got 'API improved' away?

It's a vicious circle, and yet from what I gather, PHP developers
considers this to be perfectly fine. If any PHP developers are reading
this - PHP's ODBC implementation along with its ill-bred hellspawn
odbc_longreadlen() blow so immensely they redefine the concept. It's
not a feature, it's a silly workaround for an issue that shouldn't
exist in the first place. There is absolutely no valid, sensible
reason why it works the way it works. If it's by design, then it has
been designed wrong.

Yes, some people are quite happy with odbc_longreadlen(), but maybe
they are willing to succumb to this idiocy and devise ugly hacks and
workarounds. If you have any suggestions for fighting this problem,
I'm more than willing to try anything out at this point. I've
exhausted my options, and this is quite effectively murdering me. I'm
pissed, it's cold and the wolves are after me.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:32 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.