473,472 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.

Feb 14 '07 #1
0 1180

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: memocan | last post by:
#include <iostream> using namespace std; int x; //global variable matrix int main() { x= new float ; //initialize the size now }
1
by: Steve Wathen | last post by:
I need to create a database where each record is an invoice originally stored as a csv file. Currently these csv files are loaded in excel to display them. Each invoice has a variable number of...
8
by: mark | last post by:
I have been modifying an application to enable debugging with Strict ON. I need to use the Array.Copy method and I have encountered an anomaly that I do not understand. I have reproduced the...
2
by: David Dawson | last post by:
I have forgotten a lot about SQL and would like to be (gently) reminded how to do this: In a MySQL query on the database (one table with 15 variable length fields, I want to put each field into a...
3
by: shawrie | last post by:
Hello everyone can anyone please help me? I basically want to set the length of a string variable to help spacing my simple report out. i tried dim test as string(14) but it didnt like that
3
by: chandra.krothapalli | last post by:
Hi, I am writing a program to read database logs using db2Readlog/ db2ReadLogNoConn API. I am able to parse the data of "FIXED format data" and link them to appropriate columns for a given...
2
by: rhino | last post by:
I'm working on a layout that has a variable-height middle section and need some suggestions on how I can make the bottom section adapt to that situation. Basically, I have: - a fixed-length,...
27
by: aravind | last post by:
Hi, I need to develop a menu system for a project of mine. The menu will be displayed on a character LCD display driven by ARM7 Microcontroller. For this purpose i wish to construct a structure in...
4
by: ulas | last post by:
Hi, I am designing a table in SQL Server 2008 which will contain, in each row, a list of numbers of variable length. The maximum (10) and minimum (2) list lengths are known. The most obvious...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.