Re: Handling user defined database error messages

From: <mconnors_at_mother.com>
Date: 1997/09/24
Message-ID: <01bcc8a9$edd1a920$a52168cf_at_mconnors.mother.com>#1/1


Eoin -

Using a table as you described is certainly a good way to go. Not only does it allow you to write a generic function that takes the message number as a parameter and returns the message text, you can now make the messages data-driven.

The one drawback to this approach is that it requires another trip to the server. In cases where the network is a bottleneck, this may be too high a price to pay. Another solution for the network-challenged is to create a the same function in a forms library, shared by all forms, but instead of reading the database it has a long if..elsif statment, along the lines of   if message_number = 20001 then
    return 'this text';
  elsif message_number = 20002 then
    return 'that text';
 etc.
This is certainly much more of a pain to code and maintain, but in some cases may be the way to go.

Good luck,

> I am wondering what is the best way to handle these messages in Forms. I
> do not want to hard-code all the error message texts in ON_ERROR triggers
> according to error number. I am thinking of creating a user-messages
> table in the database, and when ON_ERROR traps a user defined message, it
> selects the error text from the database using the error number and
> displays it.
>
> Eoin Gardiner
Received on Wed Sep 24 1997 - 00:00:00 CEST

Original text of this message