From: Oliver Elphick <olly@lfix.co.uk>
To: Sugandha Shah <Sugandhas@cybage.com>
Cc: Janning Vygen <vygen@gmx.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Few Queries
Date: 14 Aug 2002 14:10:46 +0100
Message-ID: <1029330646.28727.22.camel@linda> (raw)
In-Reply-To: <027601c2438e$3a6304a0$2005a8c0@cybage.com>
References: <01b301c24352$12570fb0$2005a8c0@cybage.com>
<200208140702.g7E72Cd05129@janning.planwerk6.local>
<027601c2438e$3a6304a0$2005a8c0@cybage.com>
On Wed, 2002-08-14 at 13:29, Sugandha Shah wrote:
> Hi ,
>
> No luck . Even with Select Into . Please if any body has faced similar problem and knows a solution.
>
> CREATE FUNCTION del_old_history() RETURNS int4 AS '
^^^^^^^^^^^^^
> declare
> var_history_age_limit int4;
> set_time datetime;
>
> BEGIN
> select into var_history_age_limit history_age_limit from database_info;
> IF (var_history_age_limit is not null) THEN
>
> --set_time :=select current_date()+ INTERVAL '1 day');
> select into set_time current_date()+ INTERVAL ''$var_history_age_limit days '';
> delete from history where complete_time <= set_time;
> END IF;
> return true;
^^^^^^^^^^^
> END;'
> LANGUAGE 'plpgsql';
You don't seem to be returning what you have selected. I would expect
"RETURN true;" to give you an error. Shouldn't that be "RETURN
var_history_age_limit;"?
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Let us therefore come boldly unto the throne of grace,
that we may obtain mercy, and find grace to help in
time of need." Hebrews 4:16
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: olly@lfix.co.uk, Sugandhas@cybage.com, vygen@gmx.de
Subject: Re: Few Queries
In-Reply-To: <1029330646.28727.22.camel@linda>
* 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