Junk queries with variables? - Mailing list pgsql-sql

From Steve - DND
Subject Junk queries with variables?
Date
Msg-id LDEHKBBOEMIJKHKBOFNFGEEHLLAA.postgres@digitalnothing.com
Whole thread Raw
Responses Re: Junk queries with variables?  (Michael Fuhr <mike@fuhr.org>)
Re: Junk queries with variables?  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
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




pgsql-sql by date:

Previous
From: Kai Hessing
Date:
Subject: Advanced SELECT
Next
From: Michael Fuhr
Date:
Subject: Re: Junk queries with variables?