pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wilhelm Graiss <Wilhelm.Graiss@bal.bmlfuw.gv.at>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: plpgsql related question: intervals and variables
Date: Tue, 21 Oct 2003 15:58:20 +0200
Message-ID: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00> (raw)



Hello out there,

We have a problem in plpgsql:
We want to add variable periods (result of a query) to a timestamp.

Our Code looks like this:

Begin

   heute := ''today'';
Select Into vk ourcolumn From table where other = foo;
   If vk > 0 Then
	vk_txt := ''Vorkuehlung notwendig'';        
	ez  := heute + interval ''vk days'';	
    Else
      vk_txt := ''Keine Vorkuehlung vorgeschrieben'';
   End if;

We get the following:
ERROR:  Bad interval external representation 'vk days'

The variable 'heute' is declared as timestamp,
'vk' as integer!

What have we done wrong??

:(

Thanks in advance,

Willi, Albin

--
=============================
Wilhelm Graiss
Altirdning 12
8952 Irdning
03682/22451/267






view thread (4+ messages)  latest in thread

Message-ID: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00>
Permalink:  ../40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00/
Also on:    postgresql.org/message-id/40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Wilhelm.Graiss@bal.bmlfuw.gv.at
  Subject: Re: plpgsql related question: intervals and variables
  In-Reply-To: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00>
  References: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00>

* 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