From: Richard Huxton <dev@archonet.com>
To: Wilhelm Graiss <Wilhelm.Graiss@bal.bmlfuw.gv.at>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: plpgsql related question: intervals and variables
Date: Tue, 21 Oct 2003 19:54:30 +0100
Message-ID: <200310211954.30195.dev@archonet.com> (raw)
In-Reply-To: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00>
References: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00>
On Tuesday 21 October 2003 14:58, Wilhelm Graiss wrote:
> heute := ''today'';
> Select Into vk ourcolumn From table where other = foo;
> If vk > 0 Then
> vk_txt := ''Vorkuehlung notwendig'';
> ez := heute + interval ''vk days'';
> The variable 'heute' is declared as timestamp,
> 'vk' as integer!
>
> What have we done wrong??
Quoted the vk variable. You want something like:
ez := heute + (vk || '' days'')::interval;
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, Wilhelm.Graiss@bal.bmlfuw.gv.at
Subject: Re: plpgsql related question: intervals and variables
In-Reply-To: <200310211954.30195.dev@archonet.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