Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-30 Thread Day, David
problem was in casts that I was using were confusing the parser and were un-necessary. Appreciate your thought and effort. Regards Dave From: Yasin Sari [mailto:yasinsar...@googlemail.com] Sent: Tuesday, June 30, 2015 3:26 AM To: Day, David Subject: Re: [GENERAL] plpgsql question: select

[GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Day, David
Hi, Postgres version 9.3.9 What is wrong with my usage of the plpgsql select into concept I have a function to look into a calendar table to find the first and Last weekend date of a month. In this simplified concept function I end up with a NULL for first or last weekend variable.

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Day, David
-Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Monday, June 29, 2015 4:03 PM To: Day, David; pgsql-general@postgresql.org Subject: Re: [GENERAL] plpgsql question: select into multiple variables ? On 06/29/2015 12:07 PM, Day, David wrote: Hi

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread David G. Johnston
On Mon, Jun 29, 2015 at 4:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: Adrian Klaver adrian.kla...@aklaver.com writes: On 06/29/2015 12:07 PM, Day, David wrote: What is wrong with my usage of the plpgsql select into concept I have a function to look into a calendar table to find the first

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Tom Lane
Adrian Klaver adrian.kla...@aklaver.com writes: On 06/29/2015 12:07 PM, Day, David wrote: What is wrong with my usage of the plpgsql select into concept I have a function to look into a calendar table to find the first and Last weekend date of a month. create or replace function

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Tom Lane
David G. Johnston david.g.johns...@gmail.com writes: On Mon, Jun 29, 2015 at 4:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: ... So what you wrote here is equivalent to SELECT MIN(CAL_DATE),MAX(CAL_DATE) ::date, last_weekend::date INTO first_weekend FROM sys.calendar ... ​Does it help to

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Adrian Klaver
On 06/29/2015 12:07 PM, Day, David wrote: Hi, Postgres version 9.3.9 What is wrong with my usage of the plpgsql select into concept I have a function to look into a calendar table to find the first and Last weekend date of a month. In this simplified concept function I end up with a NULL