From: Jim Buttafuoco <jim@contactbda.com>
To: 'Richard Ray' <rray@mstc.state.ms.us>
To: pgsql-sql@postgresql.org
Subject: Re: Help with quotes in plpgsql
Date: Tue, 19 Dec 2006 15:20:29 -0500
Message-ID: <200612192020.kBJKKTBS011117@amanda.contactbda.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0612191404580.30942@rray.drdc.mstc.ms.gov>
Try
select into a now() - interval ($1 || ' day')
-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Richard Ray
Sent: Tuesday, December 19, 2006 3:10 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Help with quotes in plpgsql
How should this be properly quoted
create or replace function test(integer) returns setof text as $$
declare
a record;
begin
select into a now() - interval '$1 day';
return next a;
return;
end
$$ language 'plpgsql';
I'm not having a lot of luck
Thanks
Richard
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
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: jim@contactbda.com, rray@mstc.state.ms.us
Subject: Re: Help with quotes in plpgsql
In-Reply-To: <200612192020.kBJKKTBS011117@amanda.contactbda.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