Lists: | pgsql-es-ayuda |
---|
From: | rvc <infostarsev(at)gmail(dot)com> |
---|---|
To: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | ayuda Zeos y postgres II |
Date: | 2007-03-31 08:51:59 |
Message-ID: | 7b4c59550703310151s1c4319cdk5cb971aa90bbf4e8@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-es-ayuda |
Ante todo Gracias a todos por ayudar en la medida de lo posible. Como ya
sabeis soy nuevo en esto, jejejejejejejeje como muchos por aqui.
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
Alguna Idea??????
Gracias de ante mano
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 |
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
From: | Juan Martínez <jeugenio(at)umcervantes(dot)cl> |
---|---|
To: | rvc <infostarsev(at)gmail(dot)com>, lista postrges <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: ayuda Zeos y postgres II |
Date: | 2007-03-31 11:09:09 |
Message-ID: | 460E4155.6000508@umcervantes.cl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-es-ayuda |
rvc escribió:
[no olvides la copia a la lista]
> Efectivamente, lo que no entiendo es por que me dice eso cuando yo no lo
> defino en absoluto para nada y en ningun sitio.
Por lo mismo. Debes definirlo, seguramente asignandole null o una cadena
vacia
--
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
From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
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 16:36:30 |
Message-ID: | 20070331163630.GA5761@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-es-ayuda |
rvc escribió:
> y no se por que regla de 3 me da el siguiente error:
>
> SQL Error: ERROR:column "importacion" of relation "importacion" does not
> exist
Activa log_statements para que veas cual es la sentencia exacta que esta
enviando.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
From: | Rodolfo Villanueva <infostarsev(at)gmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: ayuda Zeos y postgres II |
Date: | 2007-04-01 07:48:26 |
Message-ID: | 460F63CA.4020206@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-es-ayuda |
Pues nada amigo he echo esto que me comentabas y mira cual es mi
sorpresa sobre el asunto:
2007-04-01 09:39:33 LOG: statement: SELECT
NEXTVAL('importacion_id_importacion_seq')
2007-04-01 09:39:33 LOG: statement: INSERT INTO IMPORTACION
(IMPORTACION.id_importacion, IMPORTACION.orden, IMPORTACION.operacion,
IMPORTACION.descripcion, IMPORTACION.material, IMPORTACION.tmaterial,
IMPORTACION.puesto, IMPORTACION.centro, IMPORTACION.cantidad,
IMPORTACION.preparaciont, IMPORTACION.tratamientot) VALUES (7,
'101IA00006-A', 170, 'ASEGURAR ELEMENTOS', '000000000011008295',
'95-32340-0001B01', 'MTJAVI', 'SC01', '6', '0.1', '0.0')
2007-04-01 09:39:33 ERROR: column "importacion" of relation
"importacion" does not exist
2007-04-01 09:39:33 LOG: statement: ROLLBACK
2007-04-01 09:39:33 LOG: statement: BEGIN
2007-04-01 09:39:33 LOG: statement: SET TRANSACTION ISOLATION LEVEL
READ COMMITTED
2007-04-01 09:39:46 LOG: unexpected EOF on client connection
Ves algo anormal????
Alvaro Herrera escribió:
> rvc escribió:
>
>
>> y no se por que regla de 3 me da el siguiente error:
>>
>> SQL Error: ERROR:column "importacion" of relation "importacion" does not
>> exist
>>
>
> Activa log_statements para que veas cual es la sentencia exacta que esta
> enviando.
>
>
From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Rodolfo Villanueva <infostarsev(at)gmail(dot)com> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: ayuda Zeos y postgres II |
Date: | 2007-04-01 20:01:38 |
Message-ID: | 20070401200138.GB4336@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-es-ayuda |
Rodolfo Villanueva escribió:
> Pues nada amigo he echo esto que me comentabas y mira cual es mi
> sorpresa sobre el asunto:
>
> 2007-04-01 09:39:33 LOG: statement: SELECT
> NEXTVAL('importacion_id_importacion_seq')
> 2007-04-01 09:39:33 LOG: statement: INSERT INTO IMPORTACION
> (IMPORTACION.id_importacion, IMPORTACION.orden, IMPORTACION.operacion,
> IMPORTACION.descripcion, IMPORTACION.material, IMPORTACION.tmaterial,
> IMPORTACION.puesto, IMPORTACION.centro, IMPORTACION.cantidad,
> IMPORTACION.preparaciont, IMPORTACION.tratamientot) VALUES (7,
> '101IA00006-A', 170, 'ASEGURAR ELEMENTOS', '000000000011008295',
> '95-32340-0001B01', 'MTJAVI', 'SC01', '6', '0.1', '0.0')
> 2007-04-01 09:39:33 ERROR: column "importacion" of relation
> "importacion" does not exist
> 2007-04-01 09:39:33 LOG: statement: ROLLBACK
> 2007-04-01 09:39:33 LOG: statement: BEGIN
> 2007-04-01 09:39:33 LOG: statement: SET TRANSACTION ISOLATION LEVEL
> READ COMMITTED
> 2007-04-01 09:39:46 LOG: unexpected EOF on client connection
>
> Ves algo anormal????
Claro, la lista de columnas está incorrectamente especificada. Debería
ser así:
INSERT INTO IMPORTACION
(id_importacion, orden, operacion,
descripcion, material, tmaterial,
puesto, centro, cantidad,
preparaciont, tratamientot)
VALUES (7,
'101IA00006-A', 170, 'ASEGURAR ELEMENTOS', '000000000011008295',
'95-32340-0001B01', 'MTJAVI', 'SC01', '6', '0.1', '0.0')
Por ejemplo
alvherre=# \d sencillita
Tabla «public.sencillita»
Columna | Tipo | Modificadores
---------+---------+---------------
letra | text |
numero | integer |
alvherre=# insert into sencillita (sencillita.letra) values ('a');
ERROR: no existe la columna «sencillita» en la relación «sencillita»
LINEA 1: insert into sencillita (sencillita.letra) values ('a');
^
alvherre=# insert into sencillita (letra) values ('a');
INSERT 0 1
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support