Re: PL/pgSQL doesn't support variables in queries?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: "J(dot)A(dot)" <postgresql(at)world-domination(dot)com(dot)au>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PL/pgSQL doesn't support variables in queries?
Date: 2023-05-03 12:31:16
Message-ID: ZFJUFK5bDvpSIKFH@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 03, 2023 at 10:25:55PM +1000, J.A. wrote:
> Heya folks :)
>
> ms-sql person here migrating over to pgsql. One of the first thing's I
> noticed with pgsql (or more specifically, PL/pgSQL) is that it doesn't
> support "variables" in a query?
>
> for example, here's some T-SQL:
>
> DECLARE @fkId INTEGER

Sure it does.

There is nothing relating to "@" character, though.

You can easily find examples in docs:
https://www.postgresql.org/docs/current/plpgsql-structure.html

depesz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Loftis 2023-05-03 12:35:26 Re: libpq and multi-threading
Previous Message J.A. 2023-05-03 12:25:55 PL/pgSQL doesn't support variables in queries?