Re: Problem in Stored Procedures

Pradeepkumar, Pyatalo (IE10) wrote:

>Hi all,
>
>I m using Postgresql version 7.1.3-2.
>
>

The create type and create function does work in PostgreSQL 7.4
without any modification. I guess the features you are trying to use
are not supported in 7.1.x


Regds
Mallah.

>I have written a function which accepts 2 arguments and returns matching
>tuples from a table based on the arguments passed...but i am having problems
>in getting it work.
>This is my function -----
>
>CREATE TYPE PointType AS(ParamId INTEGER,ParamName VARCHAR(5),Is_FixEnum
>BIT,Is_ExpandEnum BIT);
>
>CREATE FUNCTION PP_ReadParameter(integer,varchar) RETURNS setof PointType AS
>'
>DECLARE
> rec PointType;
>BEGIN
> IF $1 IS NOT NULL THEN
> FOR rec IN SELECT ParamId, ParamName, Is_FixEnum, Is_ExpandEnum
> AttributeId,
>AttributeName,IsFixEnum,IsExpandEnum
> FROM Attributes
> WHERE AttributeId = $1
> ORDER BY AttributeId LOOP
> RETURN NEXT rec;
> END LOOP;
> RETURN;
> END IF;
> ELSE
> IF $2 IS NOT NULL THEN
> FOR rec IN SELECT ParamId, ParamName, Is_FixEnum,
>Is_ExpandEnum
> AttributeId,
>AttributeName,IsFixEnum,IsExpandEnum
> FROM Attributes
> WHERE AttributeId = $2
> ORDER BY AttributeId LOOP
> RETURN NEXT rec;
> END LOOP;
> RETURN;
> ELSE
> FOR rec IN SELECT ParamId, ParamName, Is_FixEnum,
>Is_ExpandEnum
> AttributeId,
>AttributeName,IsFixEnum,IsExpandEnum
> FROM Attributes
> ORDER BY AttributeId LOOP
> RETURN NEXT rec;
> END LOOP;
> RETURN;
> END IF;
> END IF;
>
>END;
>' language 'plpgsql';
>
>
>
>I get the error...
>psql:Procedures.sql:2: ERROR: parse error at or near "AS" (for CREATE TYPE
>command)
>psql:Procedures.sql:40: NOTICE: return type 'pointtype' is only a shell
>CREATE
>
>WHEN I EXECUTE THE FUNCTION USING
>SELECT (pp_readparameter(42,null));
>ERROR: fmgr_info: function 0: cache lookup failed.
>
>
>any value inputs on why this is happening.
>
>
>
>
>
>>With Best Regards
>>Pradeep Kumar P J
>>
>>
>>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>


--

regds
Mallah.

Rajesh Kumar Mallah
+---------------------------------------------------+
| Tradeindia.com (3,11,246) Registered Users |
| Indias' Leading B2B eMarketPlace |
| http://www.tradeindia.com/ |
+---------------------------------------------------+


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo [at] postgresql.org so that your
message can get through to the mailing list cleanly
mallah [ So, 11 Juli 2004 08:35 ] [ ID #452961 ]

Re:

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C48572.C9CC1E60
Content-Type: text/plain

> Les, Na grapso PG 8.0 sta arhithia mou?

We acutually use Unix on Prod and Test, however I was just playing locally
and was curious how to extent the Win version of PG 8.0.

Theo

-----Original Message-----
From: Achilleus Mantzios [mailto:achill [at] matrix.gatewaynet.com]
Sent: Wednesday, 18 August 2004 3:44 PM
To: Theo Galanakis
Subject: Re: [SQL]


O kyrios Theo Galanakis egrapse stis Aug 18, 2004 :

>
> Im running/playing with PG 8.0 locally and want to install the
> contrib/dblink and contrib/crosstab. Can this be done on Windows, is
> there a GMAKE.exe for Windows?? Someone enlighten me!

Theodore,

Sooner or later you will discover the reasons why you
should use UNIX in the first place.

>
>
> ____________________________________________________________ __________
> This email, including attachments, is intended only for the addressee
> and may be confidential, privileged and subject to copyright. If you
> have received this email in error, please advise the sender and delete
> it. If you are not the intended recipient of this email, you must not
> use, copy or disclose its content to anyone. You must not copy or
> communicate to others content that is confidential or subject to
> copyright, unless you have the consent of the content owner.

--
-Achilleus

------_=_NextPart_001_01C48572.C9CC1E60
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [SQL] </TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>> Les, Na grapso PG 8.0 sta arhithia mou?</FONT>
</P>

<P><FONT SIZE=3D2>We acutually use Unix on Prod and Test, however I was jus=
t playing locally and was curious how to extent the Win version of PG 8.0.<=
/FONT></P>

<P><FONT SIZE=3D2>Theo</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Achilleus Mantzios [<A HREF=3D"mailto:achill [at] matri=
x.gatewaynet.com">mailto:achill [at] matrix.gatewaynet.com</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, 18 August 2004 3:44 PM</FONT>
<BR><FONT SIZE=3D2>To: Theo Galanakis</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [SQL] </FONT>
</P>
<BR>

<P><FONT SIZE=3D2>O kyrios Theo Galanakis egrapse stis Aug 18, 2004 :</FONT>
</P>

<P><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> Im running/playing with PG 8.0 locally and want to =
install the </FONT>
<BR><FONT SIZE=3D2>> contrib/dblink and contrib/crosstab. Can this be do=
ne on Windows, is </FONT>
<BR><FONT SIZE=3D2>> there a GMAKE.exe for Windows?? Someone enlighten m=
e!</FONT>
</P>

<P><FONT SIZE=3D2>Theodore,</FONT>
</P>

<P><FONT SIZE=3D2>Sooner or later you will discover the reasons why you</FO=
NT>
<BR><FONT SIZE=3D2>should use UNIX in the first place.</FONT>
</P>

<P><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> ___________________________________________________=
___________________</FONT>
<BR><FONT SIZE=3D2>> This email, including attachments, is intended only=
for the addressee </FONT>
<BR><FONT SIZE=3D2>> and may be confidential, privileged and subject to =
copyright.  If you </FONT>
<BR><FONT SIZE=3D2>> have received this email in error, please advise th=
e sender and delete </FONT>
<BR><FONT SIZE=3D2>> it.  If you are not the intended recipient of =
this email, you must not </FONT>
<BR><FONT SIZE=3D2>> use, copy or disclose its content to anyone.  =
You must not copy or </FONT>
<BR><FONT SIZE=3D2>> communicate to others content that is confidential =
or subject to </FONT>
<BR><FONT SIZE=3D2>> copyright, unless you have the consent of the conte=
nt owner.</FONT>
</P>

<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>-Achilleus</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C48572.C9CC1E60--
Theo.Galanakis [ Do, 19 August 2004 00:29 ] [ ID #453342 ]
Datenbanken » comp.databases.postgresql.sql » Re: Problem in Stored Procedures

Vorheriges Thema: Function Issue!
Nächstes Thema: /contrib and win32