Home » Developer & Programmer » Forms » Get raise_application_error messages from errorstack? (Oracle Forms, Windows)
Get raise_application_error messages from errorstack? [message #662893] Mon, 15 May 2017 05:12 Go to next message
gerbenfeenstra
Messages: 1
Registered: May 2017
Junior Member
If I do a raise_application_error in one place of my program (DB backend), can I somehow retrieve this error through some errorstack in another part of my program (Forms application)?


For clarity, this is about a password_verify_function triggered by a DDL-statement to 'alter user'. It does all kinds of checks on the password and raises application error when the new password is at fault:

raise_application_error(-20001, 'This is a testerror');


The calling form (QMS0004F) does a 'forms_ddl'-call to do the 'alter user', which only returns a true or false boolean indicating the DDL statement either succeeded or failed. When false, I'd like to retreive the error and present it to the user. (I Don't necesarilly need a stacktrace, I just want to display the error and perhaps the errorcode.)


I tried some methods to get messages from the errorstack, like cg$errors.get_error_messages(), cg$errors.geterrors() and cg$errors.pop(), to no avail yet...
Re: Get raise_application_error messages from errorstack? [message #662903 is a reply to message #662893] Mon, 15 May 2017 07:15 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well if forms_ddl returns a boolean on failure then the obvious thing to do is to not use it.
Stick the alter user in a stored procedure - you'll need to use execute immediate.
Call that instead, if an error occurs it'll be raised to the form.
Previous Topic: Pass encoded Parameter
Next Topic: check if current node is parent
Goto Forum:
  


Current Time: Thu Mar 28 05:12:31 CDT 2024