Re: I must be blind... - Mailing list pgsql-general

From Joe Conway
Subject Re: I must be blind...
Date
Msg-id 3D0A2C3C.8020504@joeconway.com
Whole thread Raw
In response to I must be blind...  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Responses Re: I must be blind...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Nigel J. Andrews wrote:
<snip>
>         dirn ALIAS FOR     $4;
>         time ALIAS FOR     $5;
>         status ALIAS FOR   $6;
>     BEGIN
>         -- check against order
>         PERFORM
>             SELECT 1
>                 FROM orders
>                 WHERE
>                     id = ordid
>                     AND
>                     direction = dirn;
>         IF NOT FOUND THEN
</snip>

I don't think you can use PERFORM like that. Try:

<snip>
        dirn ALIAS FOR     $4;
        time ALIAS FOR     $5;
        status ALIAS FOR   $6;
        buf INT;
    BEGIN
        -- check against order
            SELECT 1 INTO buf
                FROM orders
                WHERE
                    id = ordid
                    AND
                    direction = dirn;
        IF NOT FOUND THEN
</snip>

HTH,

Joe


pgsql-general by date:

Previous
From: "Gavin M. Roy"
Date:
Subject: Re: Store / Retrieve image files
Next
From: Tom Lane
Date:
Subject: Re: I must be blind...