THis is kind of an Apex and Pl/Sql question, but more so Apex because I'm using that environment. I have a pl/sql process with an IF - Else statement. It's a real simple process where you check:
IF P101_Count > 1 Then
Output an error message.
The process runs when I click a button.
I am just not sure how to get an error message to display to the screen. I am not sure of the syntax.
Any help on this topic would be greatly appreciated. Thanks in advance.
Well, there a lots of ways to do this but, if you just want to see it on the screen, the easiest way is to add a Page Item (a Text Field for example). Then, in the Else portion just set it equal to the message that you are trying to display.
If ( :P101_Count > 1 ) Then
-- Do Stuff
:P1_MY_MESSAGE := 'Hello World!';
Well, you can actually use the same facility (error or success) to pop up the message.
Just put your whole snippet in a Page Process. Within that process, populate a hidden item with the value that you want to display. Within the Page Process definition screen, you will see an area to enter an Error Message and a Success Message. In those, just put the name of your hidden item, e.g. &P1_MY_HIDDEN_ITEM.
I know this is answered but you can also use the advice on this link.