Re: How can I use parameters in plain sql

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: John Adams <john_adams_mail(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How can I use parameters in plain sql
Date: 2010-09-03 19:32:43
Message-ID: AANLkTiktPJtnZ8LzuWCw7ZCDrRA+RCyB_arMbY7hQWPp@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 3, 2010 at 2:45 PM, John Adams <john_adams_mail(at)yahoo(dot)com> wrote:
> How can I use parameters in plain sql like sql server.
>
> FICTIONAL example that works for sql server:
> declare @i int;
> set @i = 1;
> select * from mytable where id=(at)i;

postgresql doesn't support variables in plain sql. psql has some
client side manged variables, and you can of course use pl/pgsql.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Kupershmidt 2010-09-03 19:35:36 Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone
Previous Message Tom Lane 2010-09-03 19:24:45 Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone