By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,650 Members | 812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,650 IT Pros & Developers. It's quick & easy.

PHP crashed when I try use bind function in PDO on Oracle

P: n/a
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

Jul 7 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 7 Jul 2006 00:48:00 -0700, "DavidPL" <da***********@gmail.comwrote:
>I have some problem with bind method in PDO on Oracle with clob | long
column type.

I have PHP 4.1.2 and Oracle 10g.
What version of PHP do you really have?

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 7 '06 #2

P: n/a
I have PHP 4.1.2 and Oracle 10g.
>
What version of PHP do you really have?
Upss... Sorry...
I have PHP 5.1.2 of coruse and Oracle 10.2g

--
Dawid Szalega

Jul 10 '06 #3

P: n/a
On Mon, 10 Jul 2006 00:16:42 -0700, DavidPL wrote:
Upss... Sorry...
I have PHP 5.1.2 of coruse and Oracle 10.2g
5.1.4 fixed many problems with PDO_OCI, but it still doesn't have get
metadata, which means that you cannot describe a cursor. In my opinion
PDO_OCI will be usable with PHP 5.2.x

--
http://www.mgogala.com

Jul 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.