Re: (Pear DB) any way to instert more than 4000 chars in a CLOB column ?

From: Date: Sat, 31 Dec 2005 15:02:20 +0000
Subject: Re: (Pear DB) any way to instert more than 4000 chars in a CLOB column ?
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-40869@lists.php.net to get a copy of this message
Olivier Mansour wrote:
Le 30 déc. 05 à 17:00, Daniel Convissor a écrit :
On Fri, Dec 30, 2005 at 04:11:24PM +0100, Olivier Mansour wrote:
With Pear DB and regular insert into sql I am limited to 4000 characters. Any simple way to deal with that ?
Or switch to MDB2, the new and improved abstraction layer.
If I could I would ;-) !
Whats stopping you? I have created patches for most (all?) PEAR packages that currently do not support MDB2. The API is different, but not radically different to make migration a real effort. However it means you get full support for LOBs. You can either pass a filename, a string or an fopen'ed ressource to MDB2 and things get streamed into the database. When reading from the database you get a file ressource handler back. $query = 'INSERT INTO files (ID, document, picture) VALUES (1, :document, :picture)'; $stmt =& $this->db->prepare($query, array('document' => 'clob', 'picture' => 'blob'), false); $stmt->bindParam('document', $character_lob); $stmt->bindParam('picture', $binary_lob); $stmt->execute(); $query = 'SELECT document, picture FROM files'; $result =& $this->db->query($query, array('clob', 'blob')); $row = $result->fetchRow(); $clob = $row[0]; // ressource $blob = $row[1]; // ressource regards, Lukas

« previous php.pear.dev (#40869) next »