Re: MS-SQL to PostgreSQL - Mailing list pgsql-general

From Alam Surya
Subject Re: MS-SQL to PostgreSQL
Date
Msg-id 001401c4f524$e8ea1820$aa01a8c0@edp
Whole thread Raw
In response to MS-SQL to PostgreSQL  ("Craig Bryden" <brydencraig@hotmail.com>)
List pgsql-general
Hi Craig....

try with this....

Declare v_maxval integer; v_minval integer;
Begin
   Select max(value),min(value) into v_maxval,v_minval from ABC;
   ............
   ............
   ............
end;

or see SELECT INTO from postgresql documentation

regards,

Alam Surya

----- Original Message -----
From: "Craig Bryden" <brydencraig@hotmail.com>
Subject: [GENERAL] MS-SQL to PostgreSQL


> Hi
>
> Below is a snippet of MS-SQL code. Please can someone translate this to
> plpgsql for me.
>
> **************************************************************
> DECLARE @MaxVal int, @MinVal int
>
> SELECT @MaxVal = MAX(Value), @MinVal = MIN(Value)
> FROM ABC
> **************************************************************
>
> The variables would then be used for purther processing.
> I know that the variables would be declared like
>
> *******************************************
> DECLARE
>     MaxVal int;
>     MinVal int;
> BEGIN
>    ???
> END;
> *******************************************
>
> I am not sure of the query part and in particular the assignment of the
> values to the variables
>
> Thank you
> Craig




pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Problem creating trigger-function with arguments (8.0rc4)
Next
From: Greg Stark
Date:
Subject: Re: ERROR: cache lookup failed for type 0