The problem is isolated to PDO ODBC -- old school ODBC works fine.
Below are my test cases.
Plain old ODBC:
<?php
// lobtestOdbc.php
$res = odbc_connect('fmarchive_mssql', 'change', 'me');
if (!$res) { die ('failed to connect'); }
$stp = 'SELECT attdata FROM fm_faxin_att WHERE id = 119085913400004 AND
attid = 0'; // statement to prepare
$ps = odbc_prepare($res, $stp);
if (!$res) { die ('failed to prepare statement'); }
$execResult = odbc_execute($ps);
echo var_export($execResult, true);
?>
The output from the plain old ODBC test case is: true
(indicating that odbc_execute succeeded, see
http://www.php.net/manual/en/function.odbc-execute.php).
Next up, PDO ODBC:
<?php
// lobtestPdoOdbc.php
try
{
$db = new PDO('odbc:fmarchive_mssql', 'change', 'me');
$stp = 'SELECT attdata FROM fm_faxin_att WHERE id = 119085913400004
AND attid = 0'; // statement to prepare
$ps = $db->prepare($stp);
$execResult = $ps->execute();
var_export($execResult, true);
}
catch (PDOException $e)
{
die($e->getMessage());
}
?>
When running lobtestPdoOdbc.php, I get the same old error:
*Fatal error*: Out of memory (allocated 262144) (tried to allocate
4294967295 bytes) in *C:\Inetpub\wwwroot\FMarchive\lobtestPdoOdbc.php*
on line *9*
I tried removing the try-catch blocks with no change in output (still
gets the exact same Fatal Error) -- not like that would be an acceptable
solution anyway.
It appears this is a problem with PDO. I'm starting to really get out
of my league now. How can I go about fixing this?
Regards,
Carlton Whitehead
Larry Garfield wrote:
On Wednesday 26 September 2007, Carlton Whitehead wrote:
Could this be some bug in the way PHP, PDO, ODBC, and/or MS SQL are
communicating? Maybe 'image' columns aren't being handled correctly?
I'm fairly certain my code is correct. I appreciate all of your comments.
Has anyone even tried querying an 'image' type column out of MS SQL 2005
using PDO ODBC?
Regards,
Carlton Whitehead
Try isolating the problem. If you have a literal query through PDO that
fails, in isolation, try the same query using the old-skool odbc routines;
just a trivial test script. If that works but the same test script converted
to minimal PDO fails, you've found a bug. If it fails in both cases, I'd
start blaming something else.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php