[Pgsql-ayuda] Error al ejecutar una funcion....

From: Gatosoft <gatosoft(at)yahoo(dot)com>
To: pgsql ayuda listapostgres <pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx>
Subject: [Pgsql-ayuda] Error al ejecutar una funcion....
Date: 2002-10-30 15:24:27
Message-ID: 20021030152427.43640.qmail@web13503.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola foro,

tengo un problema....

Cree una funcion llamada:

set_novAviso(Numeric, Integer, Integer, varchar)...
etc, que simplemente inserta un registro en una tabla.

la tabla tiene un trigger asociado, (before Insert),
que asigna un consecutivo y establece un valor para
una variable.

el caso es que se compila bien, pero a la hora de
ejecutar la funcion sucede esto:

============================================

nomina=> Select set_novAviso(135, 3, 1, 'S');

fmgr_info: function 38484231 cache lookup faile

nomina=> Select set_novAviso(135, 3, 1, 'S');

poReadData() -- backend closed the channel
unexpectedly. This probably means the backend
terminated abnormally before or while processing the
request.

The connection to the server was lost. attemping
reset: Failed.
!>
============================================

Aqui les envio la funcion:

===============================================
drop function set_novAviso(Numeric, INTEGER, INTEGER,
Varchar);
create function set_novAviso(Numeric, INTEGER,
INTEGER, Varchar) returns Integer as'
declare
ano_codigo alias for $1;
antg_mes Alias for $2;
antg_dia Alias for $3;
antg_habilidata Alias for $4;
begin
insert into novtriggers (no_codigo, ntg_mes,
ntg_dia, ntg_habilidata)
values (ano_codigo, antg_mes, antg_dia,
antg_habilidata);
Return 0;
end;
' Language 'plpgsql';
============================================
Aqui esta el trigger:

/*Drop sequence seqNovTrigger;*/
/*create sequence seqNovTrigger;*/

Drop function ftgg_NovTrigger();

create function ftgg_NovTrigger() returns Opaque as '
/* Trigger: tgg_NovTrigger*/
begin
NEW.ntg_consecutivo:=nextval(''seqNovTrigger'');

if NEW.ntg_habilidata<>''S'' then
NEW.ntg_habilidata=''N'';
end if;

return NEW;
end;
' Language 'plpgsql';

Drop Trigger tgg_NovTrigger On novtriggers;
Create Trigger tgg_NovTrigger Before Insert On
novtriggers
for each ROW Execute Procedure ftgg_NovTrigger();
================================================

Les agradezco de antemano cualquier ayuda....

PDTA: El problema es solo con esa funcin.

=====
---------------------------------------
Gatosoft
Bucaramaga/Santander/Colombia
---------------------------------------

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alejandra Garcia Wojciechowski 2002-10-30 20:47:45 [Pgsql-ayuda] Formato fecha
Previous Message jose alvaro 2002-10-29 20:01:30 [Pgsql-ayuda] Re: [Pgsql-ayuda] Instalación en Cygwin paso a paso