Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Question Unanswered: Define appication constants

    I want to use user defined constants from db2 procedure. We are using udb 8.1. Can anybody help me out?
    Last edited by siddharthaghosa; 12-27-03 at 04:49.

  2. #2
    Join Date
    Apr 2003
    Posts
    191

    Re: Define appication constants

    Hi,

    consider introducing a parameter or constants table.

    I am unaware of any concept of passing user defined constants to the database engine, and I doubt there is one.

    Johann

    Originally posted by siddharthaghosa
    I want to use user defined constants from db2 procedure. We are using udb 8.1. Can anybody help me out?

  3. #3
    Join Date
    Dec 2003
    Posts
    2

    More question

    Thanks a lot. I have considered this options. A table will make the queries complicated and slower. While if using a parameter, the constant values have to be defined at multiple places which will lead to maintenance problems in future. Oracle allows the same by defining constants within a package. Even DB does a similar thing for SQLCode (defined in SQLCA.H). Question is can developers use the same mechanism?

  4. #4
    Join Date
    Apr 2003
    Posts
    191

    Re: More question

    Hi,

    what exactly is a package in Oracle?

    Of course developers of executable code - that may be accessed through function calls from DB2 - can include header files and build functions, for example in C. In this regard, there is a way to define constants.

    But these constants live in the realm of code outside the database. I have never heard about a way to pass new constants on to the database engine for reference in SQL PL stored procedures. Is this different with Oracle?

    Johann

    Originally posted by siddharthaghosa
    Thanks a lot. I have considered this options. A table will make the queries complicated and slower. While if using a parameter, the constant values have to be defined at multiple places which will lead to maintenance problems in future. Oracle allows the same by defining constants within a package. Even DB does a similar thing for SQLCode (defined in SQLCA.H). Question is can developers use the same mechanism?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •