Home > Archive > PostgreSQL Discussion > December 2005 > Re: Correct way to set up Variables [Was - Simple Accumulating









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2005-12-30, 8:23 pm

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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com