From: | "Felipe Amezquita" <felmarla(at)gmail(dot)com> |
---|---|
To: | postgresayuda <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | rownum en postgres |
Date: | 2007-05-16 17:22:36 |
Message-ID: | bf4cfe570705161022t684e4b22lbb77d5c93c0db43c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Que tal lista
tengo la siguiente funcion en oracle y la quiero migrarla a postgres
en oracle es asi y muestra lo siguiente
CREATE OR REPLACE PROCEDURE cantidad_afiliados_G7(in_pexeq_codigo IN
number,io_cursor OUT types.tipo_cursor) as
BEGIN
DECLARE
sql_statement Varchar2(30000);
aux_numbene number;
BEGIN
sql_statement:='select PEXEQ_NUMBENE_LEB from plan_exequial where
pexeq_codigo=:0';
execute immediate sql_statement into aux_numbene using
in_pexeq_codigo;
sql_statement := 'select rownum from tipo where rownum < :1';
OPEN io_cursor FOR sql_statement using aux_numbene;
END;
END;
1
2
3
4
5
6
y yo la hice en postgres asi pero me da asi
CREATE OR REPLACE FUNCTION cantidad_afiliados_g7(in_pexeq_codigo IN numeric,
refcursor)
returns refcursor
as
$body$
DECLARE
aux_numbene numeric;
BEGIN
select PEXEQ_NUMBENE_LEB into aux_numbene from plan_exequial
where pexeq_codigo=in_pexeq_codigo;
OPEN $2 FOR select aux_numbene-1 as cantidad_afiliados;
return $2;
END;
$body$
language 'plpgsql'
6
Que debo hacer.
Gracias pos su colaboracion.
--
Ing Sistemas y Telecomunicaciones
Luis Felipe Lopez Amezquita
3008217523 - 3146286237 - 3173160602
From | Date | Subject | |
---|---|---|---|
Next Message | Miguel de la Fuente | 2007-05-16 17:47:38 | uso de indices con ilike |
Previous Message | Jota Machuca | 2007-05-16 16:35:14 | Separar por puntos resultado numerico |