1

Silly question, how do I sit in PGAdmin and declare a variable to be used later in inline statements?

Declare par_callcenterid integer;

yields:

ERROR: syntax error at or near "integer" LINE 1: Declare par_callcenterid integer;

KTrock
  • 31
  • 2

1 Answers1

0

Some people use temporary tables for storing such values. Another way would be to write set/get functions in a language that supports global storage (PL/Perl, PL/Tcl, PL/Python, etc.). See for example the set_var() and get_var() functions in the PL/Perl documentation:

See documentation

Maxim Kasyanov
  • 938
  • 5
  • 14
  • Thanks, but you're showing me documentation on functions, where declaring variables works. I'm in the editor or command line; whatever you would call it, and using plpgsql. – KTrock May 31 '18 at 21:20