You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by steph <pr...@free.fr> on 2004/01/21 11:35:28 UTC

XML / postgresql and blob

Hello,

first of all, I must say that I am an (happy) beginner with cocoon and
postgresql.

I created a postgres database in which I store blob (Binary Large OBjet
such as jpeg images).

Though, I use <sql:query> to do all of my queries but I really don't
know how to access to a blob.
in PHP the code will be something like :

<?php
  $db = pg_connect("dbname=db-pfe host=localhost user=apache");
  pg_freeresult(pg_exec($db, "begin"));
  $lo = pg_loopen($db, 164907, "r");

  header("Content-type: image/jpeg");

  pg_loreadall($lo);
  pg_loclose($lo);
  pg_freeresult(pg_exec($db, "rollback"));
  pg_close($db);
?>

My main problem is the use of lo_open lo_read and others in XML/XSL. 
(I do not find any example on the web with these funtions)


thank you in advance, 
Stephane


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XML / postgresql and blob

Posted by Miles Elam <mi...@pcextremist.com>.
steph wrote:

>I created a postgres database in which I store blob (Binary Large OBjet
>such as jpeg images).
>
>Though, I use <sql:query> to do all of my queries but I really don't
>know how to access to a blob.
>  
>
...

>My main problem is the use of lo_open lo_read and others in XML/XSL. 
>(I do not find any example on the web with these funtions)
>  
>

I think you're looking for a DatabaseReader.

http://cocoon.apache.org/2.1/userdocs/readers/database-reader.html

Best wishes,

Miles Elam


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org