Re: [SQL] plpgsql related question: intervals and variables

2003-10-21 Thread Stephan Szabo
On Tue, 21 Oct 2003, Josh Berkus 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''; > > PL/pgSQL handles variable like SQL, not like PHP or Perl

Re: [SQL] plpgsql related question: intervals and variables

2003-10-21 Thread Richard Huxton
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,

Re: [SQL] plpgsql related question: intervals and variables

2003-10-21 Thread Josh Berkus
Willhelm, > 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''; PL/pgSQL handles variable like SQL, not like PHP or Perl. You can't do

[SQL] plpgsql related question: intervals and variables

2003-10-21 Thread Wilhelm Graiss
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'';