Re: Junk queries with variables?

From: Bricklen Anderson <BAnderson(at)PresiNET(dot)com>
To: Steve - DND <postgres(at)digitalnothing(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Junk queries with variables?
Date: 2005-02-24 17:17:42
Message-ID: 421E0C36.2030103@PresiNET.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Steve - DND wrote:
>>I don't know about pgAdmin, but in psql you can use \set:
>>
>>\set id 1
>>SELECT * FROM foo WHERE id = :id;
>>
>>\set name '\'Some Name\''
>>SELECT * FROM foo WHERE name = :name;
>>
>
>
> Whenever I try the above I get an error at the backslash. Do I need to
> create a different language for this? Right now I only have plpgsql
> available.
>
> Thanks,
> Steve
>
\set name text('Some Name')
SELECT * FROM foo WHERE name = :name;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kent Anderson 2005-02-24 17:17:48 How do you compare contents of two tables using 2 pk
Previous Message Steve Valaitis 2005-02-24 17:15:43 Re: Junk queries with variables?