My session 'Developing a Real-World logistic application with Oracle Application Express' (S301752) is scheduled on Monday Sept 22 from 13:00 to 14:00 in Room 309 in Moscone South. It's a big room with nearly 300 seats, so don't hesitate to add this one to your schedule. There are 'only' 89 other sessions planned in this same time slot, so there is a lot of competition going on!
If you run your APEX application - like a Form based on the EMP table - and test if you can change the value of Department to something else then the standard values of 10, 20, 30 or 40, you'll get a nice error message like this: But it isn't really nice, is it? So what do a lot of developers do? They create a validation (just) in order to show a nicer, better worded, error message like "This is not a valid department". And what you then just did is writing code twice : Once in the database as a (foreign key) check constraint and once as a sql statement in your validation. And we all know : writing code twice is usually not a good idea - and executing the same query twice is not enhancing your performance! So how can we transform that ugly error message into something nice? By combining two APEX features: the Error Handling Function and the Text Messages! Start with copying the example of an Error Handling Function from the APEX documentation. Create this function ...
Comments