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




---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to