If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Define appication constants

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-03, 03:45
siddharthaghosa siddharthaghosa is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Question 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 03:49.
Reply With Quote
  #2 (permalink)  
Old 12-29-03, 06:33
jsander jsander is offline
Registered User
 
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

Quote:
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?
Reply With Quote
  #3 (permalink)  
Old 12-29-03, 23:10
siddharthaghosa siddharthaghosa is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 12-30-03, 04:49
jsander jsander is offline
Registered User
 
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

Quote:
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On