hi,

we are creating a program on which when an error occurs it should produce an alert message that will display what kind of error and its error messge.. however, were having difficulty on how to declare the exception inside the code that we have already created. since we are using the if-statement.

we are really new about this exception handler.. so here's our code.

DECLARE
ALERT NUMBER;
begin
if :chkselect = 1 then
forms_ddl('grant select on ' || :table_name || 'to '|| :role);
end if;

if :chkinsert = 1 then
forms_ddl('grant insert on ' || :table_name || ' to ' || :role);
end if;

if :chkupdate = 1 then
forms_ddl('grant update on ' || :table_name || ' to ' || :role);
end if;

if :chkdelete = 1 then
forms_ddl('grant delete on ' || :table_name || ' to ' || :role);
end if;

end;

----
this is what weve come up with, and its not functioning correctly so if you have any idea on how to insert it on the code above and what's wrong with this code.. thanks..

IF SQLCODE = -1917 THEN
ALERT := SHOW_ALERT('ERROR');
END IF;
IF SQLCODE = -942 THEN
ALERT := SHOW_ALERT('ERROR');
END IF;