From: Steve - DND <postgres@digitalnothing.com>
To: pgsql-sql@postgresql.org
Subject: Junk queries with variables?
Date: Wed, 23 Feb 2005 23:12:47 -0700
Message-ID: <LDEHKBBOEMIJKHKBOFNFGEEHLLAA.postgres@digitalnothing.com> (raw)
I really have to be missing something here and this probably a *really* noob
question. I don't have a problem running little junk queries in the pgAdmin
query window(SELECT blah FROM blah, INSERT INTO blah, etc...), but I can't
figure out how to run queries with variables outside of a function. I just
want to use variables without having to go about creating and dropping a
function for every stupid little query I need to write. Example:
amount int4 := 1000;
earliest_date timestamp := current_timestamp;
SELECT ...
I always get the error: "ERROR: syntax error at or near "amount" at
character 1". What have I done wrong, or am I missing?
Thanks,
Steve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: postgres@digitalnothing.com
Subject: Re: Junk queries with variables?
In-Reply-To: <LDEHKBBOEMIJKHKBOFNFGEEHLLAA.postgres@digitalnothing.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox