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

From: Date: Sun, 01 Jan 2006 14:29:29 +0000
Subject: Re: (Pear DB) any way to instert more than 4000 chars in a CLOB column ?
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-40876@lists.php.net to get a copy of this message
Le 31 déc. 05 à 16:02, Lukas Smith a écrit :
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?
Mostly time was missing, so I used an horrible hack with oci functions .... :-( temporary Actually we are working of a large piece of software (SPIP-Agora : http://www.agora.gouv.fr) wich is already operating lot of the french government web sites (like http://www.premier-ministre.gouv.fr/ or http://www.travail.gouv.fr/). It's using DB but, as MDB2 seems to me very interessing in many ways, I am thinking to switch to it. Thanks for the code below and happy new year ! regards Olivier
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
-- Olivier Mansour omansour@gmail.com http://www.glagla.org http://www.podcastfr.info

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