Richard Ray wrote:
It makes sense when ya'll explain it
It never sounds that good when I'm talkin to myself
That solves my problem but not my ignorance
I'm still curious about how would I properly quote
create or replace function test(integer) returns setof text as $$
declare
a record;
begin
It makes sense when ya'll explain it
It never sounds that good when I'm talkin to myself
That solves my problem but not my ignorance
I'm still curious about how would I properly quote
create or replace function test(integer) returns setof text as $$
declare
a record;
begin
select into a now()
"Hector Villarreal" <[EMAIL PROTECTED]> writes:
>select into a now() - ($1::text||'days')::interval;
People keep suggesting variants of that as ways to convert numeric
values to intervals, but it's really extremely bad practice. Much
better is to use number-times-interval multiplication:
::interval;
return next a;
return;
end
$$ language 'plpgsql';
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Milen A. Radev
Sent: Tuesday, December 19, 2006 2:54 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Help with quotes in plpgsql
Richard Ray написа:
> On Tue, 19 Dec 2006, Milen A. Radev wrote:
>
>> Richard Ray :
>>> 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';
>>>
am Tue, dem 19.12.2006, um 14:09:37 -0600 mailte Richard Ray folgendes:
> 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
> $$
On Tue, 19 Dec 2006, Milen A. Radev wrote:
Richard Ray :
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';
: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
$$
turn;
end
$$ language 'plpgsql';
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Richard Ray
Sent: Tuesday, December 19, 2006 12:10 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Help with quotes in plpgsql
How should this be properly
Richard Ray написа:
> 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 luc
Try
select into a now() - interval ($1 || ' day')
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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 b
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
---
12 matches
Mail list logo