Search Postgresql Archives

Re: initialize and use variable in query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks! 

On Sat, Dec 29, 2018 at 10:06 AM David G. Johnston <david.g.johnston@xxxxxxxxx> wrote:
On Saturday, December 29, 2018, Ray O'Donnell <ray@xxxxxxxxxxxx> wrote:
A couple of things off the top of my head:

Sorry but, no. 

(i) I think you need "language plpgsql" (or whatever) after the DO block.

As the docs state plpgsql is the default for a DO block lacking a language specifier. 


(ii) That assignment in the DO should probably be:

  select max(fctrdt) into startdate from fnmloan;

The original form is perfectly valid plpgsql;

The DO block worked just fine.  It’s just that everything it did was discarded at the end of it because nothing that permanently affected the parent SQL session happened.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux