|
Posted by DavidPL on 07/07/06 07:48
Hello,
I have some problem with bind method in PDO on Oracle with clob | long
column type.
I have table named TEST_TABLE where I have two columns: ID (int 10, 0)
and TEXT (varchar 4000 or long or clob).
When I try execute PHP code (based on example in manual):
<?php
$sql = 'SELECT id, text FROM test_table';
try
{
$stmt = $this->m_pdoConnection->prepare($sql);
$stmt->execute();
/* Bind by column number */
$stmt->bindColumn(1, $id);
$stmt->bindColumn(2, $text);
while ($row = $stmt->fetch(PDO::FETCH_BOUND))
{
$data = $id . "\t" . $text . "\t";
print $data;
}
}
catch (PDOException $e)
{
print $e->getMessage();
}
?>
When column TEXT type is varchar(4000) all works ok, but I can write
text only to 4000 chars.
When column type is long I have: "Warning: PDOStatement::fetch()
[function.fetch]: column 1 data was too large for buffer and was
truncated to fit it in ...skrypt.php... on line ...xxx...", and text in
$text is cut to 1000 chars, and...
When column type is clob PHP is crashed.
I have PHP 4.1.2 and Oracle 10g.
Please check this if You can.
Thanks
--
Dawid Szalega
Navigation:
[Reply to this message]
|