Thread: Declaring constants in PG/PLSQL

Declaring constants in PG/PLSQL

From
Mark Hesketh
Date:
  Hi all,

Can someone tell me if it's possible to globally scope my constants? How
do I declare them for reuse? Don't tell me I have to keep defining them
atop each function... :|

cheerz.
Mark


Re: Declaring constants in PG/PLSQL

From
Oliver Elphick
Date:
On Mon, 2002-01-21 at 14:37, Mark Hesketh wrote:
>   Hi all,
>
> Can someone tell me if it's possible to globally scope my constants? How
> do I declare them for reuse? Don't tell me I have to keep defining them
> atop each function... :|

Why not create some functions that return your constants?

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     "For we wrestle not against flesh and blood, but
      against principalities, against powers, against the
      rulers of the darkness of this world, against
      spiritual wickedness in high places. Wherefore take
      unto you the whole armour of God, that ye may be able
      to withstand in the evil day, and having done all, to
      stand."              Ephesians 6:12,13

Attachment

Re: Declaring constants in PG/PLSQL

From
Mark Hesketh
Date:
Oliver Elphick wrote:

>On Mon, 2002-01-21 at 14:37, Mark Hesketh wrote:
>
>>  Hi all,
>>
>>Can someone tell me if it's possible to globally scope my constants? How
>>do I declare them for reuse? Don't tell me I have to keep defining them
>>atop each function... :|
>>
>
>Why not create some functions that return your constants?
>
Thanks for the replies guys.

Yeah, it's certainly not something I've seen much of even with PL/SQL.

I think I'll just declare them via functions - it keeps it cleaner that
way - less hassle. I should really define them externally,
perhaps a property file but, they're for internal use (return codes) so
that's a little overkill.

Mark



Disk I/O

From
denis@coralindia.com
Date:
Hi all

I am fresher to postgres...

Is there any function / procedure in Postgres to write to TXT file and read
that file (like we have UTL_FILE in Oracle and TEXT_IO in Developer 6)

Thanx

Denis



Re: Disk I/O

From
Frank Bax
Date:
At 11:27 AM 1/24/02 +0530, denis@coralindia.com wrote:
>Is there any function / procedure in Postgres to write to TXT file and read
>that file (like we have UTL_FILE in Oracle and TEXT_IO in Developer 6)

http://postgresql.org/users-lounge/docs/7.1/reference/
Follow links for "SQL COPY", "PG_DUMP", "PG_DUMPALL".