Re: Insertar imagen tipo bytea

From: "postgres Emanuel CALVO FRANCO" <postgres(dot)arg(at)gmail(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Insertar imagen tipo bytea
Date: 2008-09-30 14:22:51
Message-ID: f205bb120809300722u76b891fdu547a76174ae10b6f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

El día 30 de septiembre de 2008 3:41, Linder Poclaba Lazaro
<linderlpl(at)gmail(dot)com> escribió:
>
> Buenas lista no puedo salir de un problema, no he podido insertar una imagen
> a mi base de datos tengo la version 8.3 uso persistencia en java, al
> realizar la insercion me sale este mensaje de error:
>
> [TopLink Warning]: 2008.09.30 02:23:41.962--UnitOfWork(11595950)--Exception
> [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs
> (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: column
> "imagen" is of type bytea but expression is of type oid
> Error Code: 0
> Call: INSERT INTO public.joya (estado, cliente_idcliente, cantidad,
> peso_otros, imagen, descripcion, peso_bruto, inscripciones, tasacion,
> idpreforma_joya, kilataje_idkilataje, tipo_joya_idtipo_joya) VALUES (?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
> bind => [muy bueno, 0, 1, 1.3, null, anillo de oro, 44.0, regalo,
> 4.0, 13, 1, 1]
>
> la tabla es sencilla:
>
> CREATE TABLE joya
> (
> idjoya serial primary key,
> tipo_joya_idtipo_joya integer references tipo_joya,
> kilataje_idkilataje integer references kilataje,
> preforma_joya_idpreforma_joya integer references preforma_joya,
> cliente_idcliente integer references cliente,
> peso_bruto double precision,
> cantidad integer,
> tasacion double precision,
> imagen bytea,
> inscripciones text,
> estado text,
> peso_otros double precision NOT NULL,
> descripcion text NOT NULL,
> )
>
> Alguien podria darme alguna idea porque genera esa excepcion, desde ya
> muchas gracias.
>
>
>

Tenes que utilizar la funcion lo_import(ruta) para importar imagenes,
en el tipo bytea.

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2008-09-30 15:18:41 Re: Insertar imagen tipo bytea
Previous Message postgres Emanuel CALVO FRANCO 2008-09-30 14:13:47 Re: Modificar WHERE en rule