Error en funcion

From: jeferson alvarez <jalvarez(at)renova(dot)com(dot)pe>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Error en funcion
Date: 2007-02-08 19:44:54
Message-ID: 45CB7DB6.60201@renova.com.pe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola a todos este es mi nuevo problemilla vean esta es la funcion
----------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE FUNCTION alm_t_detalle_Eliminar(ialdt_ch_id
char(50),ialdt_in_orden int4)
RETURNS setof Type_alm_t_detalle_Eliminar_obtener AS
$BODY$
DECLARE

BEGIN
delete from alm_t_detalle where aldt_ch_id=$1 and aldt_in_orden=$2;

create temp sequence OrdenItem;

select nextval('OrdenItem') as
orden,td.arti_in_id,a.arti_vc_descripcion,c.conc_vc_desc,td.aldt_do_cantidad,td.aldt_do_valor_unitario,

td.aldt_do_subtotal,td.aldt_ch_id,td.aldt_in_idcab,td.aldt_in_iddet,td.aldt_ch_doc_corre
from alm_t_detalle td
inner join sgc_m_articulo a on td.arti_in_id = a.arti_in_id
INNER JOIN sgc_m_conceptos C ON
c.conc_ch_codigo=a.arti_ch_und and c.conc_ch_tipo='UMD'
where aldt_ch_id=$1 and aldt_in_orden=$2;

drop sequence OrdenItem;
RETURN;

END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
------------------------------------------------------------------------------------------------------------------
*****este es el typo retornado

CREATE TYPE Type_alm_t_detalle_Eliminar_obtener AS
(orden int8,
arti_in_id int4,
arti_vc_descripcion varchar(350),
conc_vc_desc char(10),
aldt_do_cantidad numeric,
aldt_do_valor_unitario numeric,
aldt_do_subtotal numeric,
aldt_ch_id varchar(50),
aldt_in_idcab int4,
aldt_in_iddet int4,
aldt_ch_doc_corre char(15));
---------------------------------------------------------------------------------------------------------------------------
*****esta es la prueba d ela funcion
select alm_t_detalle_Eliminar('1192.168.1.78cahUESNotaSalida',10)
---------------------------------------------------------------------------------------------------------------------------
*****y este el error que me da al ejecutar la prueba en que estoy fallando

ERROR: SELECT query has no destination for result data
HINT: If you want to discard the results, use PERFORM instead.
CONTEXT: PL/pgSQL function "alm_t_detalle_eliminar" line 8 at SQL statement

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message GABRIEL COLINA 2007-02-08 20:36:15 Re: Alter table
Previous Message jeferson alvarez 2007-02-08 19:44:41 Re: AYUDITA CON UNA FUNCION