| From: | "Steve - DND" <postgres(at)digitalnothing(dot)com> |
|---|---|
| To: | <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Junk queries with variables? |
| Date: | 2005-02-24 06:12:47 |
| Message-ID: | LDEHKBBOEMIJKHKBOFNFGEEHLLAA.postgres@digitalnothing.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Fuhr | 2005-02-24 07:40:46 | Re: Junk queries with variables? |
| Previous Message | Keith Worthington | 2005-02-24 03:56:30 | Re: aggregate / group by question |