How Do I Read In A CLOB Column That's Too Large To Fit In A String?
Solution 1:
Based on your comments:
If you right click in your browser and say "view source" you'll see that you indeed have the entire file.
Most likely you just need to set the appropriate ContentType when emitting the data back to the browser.
Solution 2:
First, try increasing the PHP memory limit to see if that has any effect on the error. If the CLOB object being retrieved is truly huge, like 2 GiB, then there is no way (currently) to process it in PHP since the whole object must be held in memory.
If the column has fixed length data, it should be fairly easy to compose an appropriate query which extracts a portion of it. Assuming the data is encoded as fixed-length text, then something like this will work:
// assumes subfield is xxx.xxx.xxx.xxx: 19 fixed characters
SELECT substr (TO_CHAR(gnarly_ipadddress_fieldname), 1, 19) as ipaddr1,
substr (TO_CHAR(gnarly_ipadddress_fieldname), 20, 19) as ipaddr2,
substr (TO_CHAR(gnarly_ipadddress_fieldname), 39, 19) as ipaddr3
FROM table
WHERE (whatever);
If the subfields are variable length, then maybe grabbing something like 16K chunks and parsing it in PHP is the way to go.
Post a Comment for "How Do I Read In A CLOB Column That's Too Large To Fit In A String?"