Re: Problem in Stored Procedures

Re: Problem in Stored Procedures

am 11.07.2004 08:35:10 von mallah

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@postgresql.org so that your
message can get through to the mailing list cleanly

Re:

am 19.08.2004 00:29:13 von Theo.Galanakis

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@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






RE: [SQL]



> Les, Na grapso PG 8.0 sta arhithia mou?



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>



Theo



-----Original Message-----

From: Achilleus Mantzios [ x.gatewaynet.com">mailto:achill@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 do=
ne on Windows, is


> there a GMAKE.exe for Windows?? Someone enlighten m=
e!



Theodore,



Sooner or later you will discover the reasons why you NT>

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 th=
e 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 conte=
nt owner.



--

-Achilleus





------_=_NextPart_001_01C48572.C9CC1E60--