[EMAIL PROTECTED] says...
> (SELECT * FROM history WHERE obs_type = \'AA\' )
> UNION
> (SELECT * FROM history WHERE obs_type = \'TA\');
Maybe I'm just confused here, but what's to stop you using
SELECT * FROM History WHERE (Obs_Type = \'AA\' AND Obs_Type = \'TA\')
? Or have I mi
uot; <[EMAIL PROTECTED]>
Cc: ""Kumar"" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 8:50 PM
Subject: Re: [SQL] Using UNION inside a cursor
> Christoph Haller <[EMAIL PROTECTED]> writes:
> >> OPEN ref FOR
> >>
Christoph Haller <[EMAIL PROTECTED]> writes:
>> OPEN ref FOR
>> (SELECT * FROM history WHERE obs_type =3D \'AA\' )
>> UNION
>> (SELECT * FROM history WHERE obs_type =3D \'TA\');
> My suspicion is the plpgsql parser doesn't accept the opening
> parenthesis.
Yeah. Looking at the plpgsql gr
Hi Christoph Haller,
Thanks you very much. It worked.
- Original Message -
From: "Christoph Haller" <[EMAIL PROTECTED]>
To: ""Kumar"" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 3:56 PM
Subject: Re:
>
> Dear Friends,
>
> I am working on Postgresql 7.3.4 on RH Linux Server 7.3.=20
>
> I have problem in executing the following procedure
>
> CREATE OR REPLACE FUNCTION list_history()
> RETURNS refcursor AS
> 'DECLARE
> ref REFCURSOR;
> BEGIN
> OPEN ref FOR
> (SELECT * FROM history WHE
Dear Friends,
I am working on Postgresql 7.3.4 on RH Linux Server 7.3.
I have problem in executing the following
procedure
CREATE OR REPLACE FUNCTION list_history()
RETURNS refcursor
AS'DECLARE ref REFCURSOR;BEGIN OPEN
ref FOR (SELECT * FROM history WHERE obs_type =
\'AA\' ) UN