Re: ayuda Zeos y postgres II

From: Juan Martínez <jeugenio(at)umcervantes(dot)cl>
To: rvc <infostarsev(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: ayuda Zeos y postgres II
Date: 2007-03-31 09:07:43
Message-ID: 460E24DF.4000701@umcervantes.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

rvc escribió:
> Bueno la cuestion es la siguiente yo tengo definida una tabla con los
> siguientes valores:
>
> CREATE TABLE importacion
> (
> id_importacion serial NOT NULL,
> orden character varying(40),
> operacion integer,
> descripcion character varying(40),
> material character varying(40),
> tmaterial character varying(40),
> puesto character varying(40),
> centro character varying(40),
> cantidad character varying(40),
> preparaciont character varying(40),
> tratamientot character varying(5),
> importacion integer
> )
> WITHOUT OIDS;
> ALTER TABLE importacion OWNER TO postgres;
>
> Cuando intento agregar un registro hago lo siguiente(OJO Uso delphi 7
> + Zeos 6.6.0 - beta):
>
> Dat.Secuencia.SequenceName:='importacion_id_importacion_seq';
>
> Dat.IMPORTACION.Append;
>
> Dat.IMPORTACION.FieldByName('ID_IMPORTACION').AsInteger:=Dat.Secuencia.GetNextValue;
> Dat.IMPORTACION.FieldByName('ORDEN').AsString:=Campo[1];
> Dat.IMPORTACION.FieldByName ('OPERACION').AsString:=Campo[2];
> Dat.IMPORTACION.FieldByName('DESCRIPCION').AsString:=Campo[3];
> Dat.IMPORTACION.FieldByName('MATERIAL').AsString:=Campo[4];
> Dat.IMPORTACION.FieldByName ('TMATERIAL').AsString:=Campo[5];
> Dat.IMPORTACION.FieldByName('PUESTO').AsString:=Campo[6];
> Dat.IMPORTACION.FieldByName('CENTRO').AsString:=Campo[7];
> Dat.IMPORTACION.FieldByName ('CANTIDAD').AsString:=Str2;
> Dat.IMPORTACION.FieldByName('PREPARACIONT').AsString:=Campo[9];
> Dat.IMPORTACION.FieldByName('TRATAMIENTOT').AsString:=Campo[10];
>
> Dat.IMPORTACION.Post;
>
>
> y no se por que regla de 3 me da el siguiente error:
>
> SQL Error: ERROR:column "importacion" of relation "importacion" does
> not exist

Sin tener idea de Delfin (:-D no me aguante), perdon Delphi, creo que
pueden ser dos cosas:

1. Por alguna razon que desconozco el DML embebido de Delphi exige que
definas un valor para todas las columnas. Curiosamente en lo que pones,
no hay referencia a la columna 'importacion'.

2. Puede que este mal definido tu objeto.

No hay manera de escribir esto mas bonito?

--
Juan Martinez G. Mac Iver # 370
Departamento de Informatica 4997900 - 4997950
Universidad Miguel de Cervantes Santiago - Chile
http://download.bblug.usla.org.ar/netiquette.png

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Miguel Juan 2007-03-31 11:05:14 Re: Importar fichero CSV
Previous Message rvc 2007-03-31 08:51:59 ayuda Zeos y postgres II