[Pgsql-ayuda] Problemas con Funciones

John Medina john.medina@e-gattaca.com
Mon, 16 Jun 2003 10:50:31 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_011C_01C333F5.1B3AD370
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Se=F1ores,

Estoy utilizando postgreSQL 7.2.2 en una maquina LINUX  y  la estoy =
accediendo a trav=E9s de PGADMIN II versi=F3n 1.4.12. Y se me esta =
presentando la siguiente situaci=F3n:

Tengo una tabla llamada STKAPPVALUES, la cual tiene la siguiente =
estructura:

CREATE TABLE stkappvalues (
apvid numeric(10, 0) NOT NULL,=20
apvvalue varchar(512) NOT NULL,=20
CONSTRAINT stkappvalues_pk_apvid PRIMARY KEY (apvid)
) WITH OIDS;

El contenido es:

apvid      appvalue
------------------------
1             100000
2              5
3              0.05


Cre=E9 una funci=F3n:

CREATE FUNCTION apvpkg_listappvalues() RETURNS stkappvalues AS '
SELECT stkappvalues.apvid, stkappvalues.apvvalue FROM stkappvalues;
' LANGUAGE 'sql';

Para retornar los valores de dicha tabla! , y al invocarla...

SELECT apvpkg_listappvalues() ;

Me retorna en ocasiones :=20

apvpkg_listappvalues
------------------------------
138008920
138008920
138008920

o en ocasiones:

apvpkg_listappvalues
--------------------------------
137885928
137885928
137885928


Pero NO los datos q se supone debe regresar.

Agradezco cualquier tipo de colaboraci=F3n , que me permita solucionar o =
encontrar cual es el problema.



John Alexander Medina Torres
Analista de Proyectos
Gattaca S.A.
--------------------------------------------
Cr 13 a No 89 - 53 (203)
Bogot=E1 - Colombia
Tel. (571) 6114265
               6105568
               4810415
www.e-Gattaca.com
--------------------------------------------
------=_NextPart_000_011C_01C333F5.1B3AD370
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>
<DIV><FONT face=3DArial size=3D2>Se=F1ores,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Estoy utilizando postgreSQL 7.2.2 en =
una maquina=20
LINUX&nbsp; y&nbsp; la estoy accediendo a trav=E9s de PGADMIN II =
versi=F3n 1.4.12. Y=20
se me esta presentando la siguiente situaci=F3n:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Tengo una tabla llamada STKAPPVALUES, =
la cual tiene=20
la siguiente estructura:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CREATE TABLE stkappvalues =
(</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>apvid numeric(10, 0) NOT NULL, =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>apvvalue varchar(512) NOT NULL, =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CONSTRAINT stkappvalues_pk_apvid =
PRIMARY KEY=20
(apvid)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>) WITH OIDS;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>El contenido es:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>apvid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
appvalue<BR>------------------------<BR>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
100000<BR>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
5<BR>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
0.05</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cre=E9 una funci=F3n:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CREATE FUNCTION apvpkg_listappvalues() =
RETURNS=20
stkappvalues AS '<BR>SELECT stkappvalues.apvid, stkappvalues.apvvalue =
FROM=20
stkappvalues;<BR>' LANGUAGE 'sql';</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Para retornar los valores de dicha =
tabla! , y al=20
invocarla...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SELECT apvpkg_listappvalues() =
;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Me retorna en ocasiones : </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>apvpkg_listappvalues</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>------------------------------</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>138008920<BR>138008920<BR>138008920</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>o en ocasiones:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>apvpkg_listappvalues</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>--------------------------------</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>137885928<BR>137885928<BR>137885928</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Pero NO los datos q se supone debe=20
regresar.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Agradezco cualquier tipo de =
colaboraci=F3n , que me=20
permita solucionar o encontrar cual es el problema.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>John Alexander Medina =
Torres<BR>Analista de=20
Proyectos<BR>Gattaca =
S.A.<BR>--------------------------------------------<BR>Cr=20
13 a No 89 - 53 (203)<BR>Bogot=E1 - Colombia<BR>Tel. (571)=20
6114265<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
6105568<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
4810415<BR><A=20
href=3D"http://www.e-Gattaca.com">www.e-Gattaca.com</A><BR>--------------=
------------------------------</FONT></DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_011C_01C333F5.1B3AD370--