[Pgsql-ayuda] plpgsql que tipo de dato es un recordset para una function
Sergio Cisternas
scisternas@yx.cl
Thu, 19 Jun 2003 16:57:28 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_00E5_01C33683.DDBA0FC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hola alguen podria decirme que tipo de dato debe delvolver
un functon si quieres entregar un recordset
create o replace function hola(int) returns ?? as=20
' declare
xxx alias for $1 ;
rs ???;
begin=20
if xxx>0 then
rs :=3D(select * from xx where id_xx=3Dxxx);
else
rs:=3D (select * from xx);
end if ;
return rs;
end '
language 'plpgsql' ;
Gracias
------=_NextPart_000_00E5_01C33683.DDBA0FC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hola alguen podria decirme que tipo de =
dato debe=20
delvolver</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>un functon si quieres entregar un=20
recordset</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>create o replace function hola(int) =
returns ?? as=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>' declare</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>xxx alias for $1 =
;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>rs ???;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>begin </FONT></DIV>
<DIV><FONT face=3DArial size=3D2> if xxx>0 =
then</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
rs :=3D(select=20
* from xx where id_xx=3Dxxx);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> else</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
rs:=3D (select=20
* from xx);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> end if =
;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>return rs;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>end '</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>language 'plpgsql' ;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Gracias</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_00E5_01C33683.DDBA0FC0--