Re: Correct way to set up Variables [Was - Simple Accumulating

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Ubence Quevedo <r0d3nt(at)pacbell(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Correct way to set up Variables [Was - Simple Accumulating
Date: 2005-12-30 23:57:14
Message-ID: 43B5C95A.407@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ubence Quevedo schrieb:
> What would be the correct way to set up a dynamic
> variable? I did some further research on my question
> below, and I still don't have a definite answer to
> whether or not use \set or SET. I did read at
> http://www.commandprompt.com/ppbook/x19832 about using
> variables in a Function, but that seems like an awful
> lot to do [or does MS SQL make it easier than
> PostgreSQL?]. Any help, ideas, or clarification are
> much appreciated.

Dont mix frontend and backend in your approach.
You can specify variables in whatever way your
stored function handles it (e.g. it depends on
the language you use. Examples for pl/pgsql
are in the docs.)
In Postgres you dont write arbitrary code
to the server. You write stored functions
(server side) or you write SQL statements.

Any further variable handling is up to your
host/application language.

psql, the command line client application
does not have variables as such nor any
flow control.

Regards
Tino Wildenhain

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jure Ložar 2005-12-31 00:06:23 How to read wal?
Previous Message Harry Jackson 2005-12-30 22:39:30 Re: Forum Software