Small issue with pgscript component
Posted: Fri 09 Jan 2009 21:02
Hi,
I have been using the script component as a work around for the inability of the query component to execute multiple commands and for the most part it works ok, except when a error occurs.
In most of my situations I have my own exception handler, for example
try
myscript.sql.add('some sql');
myscript.sql.add('some sql');
myscript.sql.add('somesql');
excute; //does not allow script exceptions to bubble up
modalresult:=mrok;
except
on e:exception do
showmessage(e.message);
end;
Because the script handles the errors it always executes the modalresult line, I tried using the scripts on error handler but it does not work the way I need it to.
The error handler would be ok if it had a option to abort and re raise the exception so the outside error handler picks up the exception.
I tried to re raise the exception that is passed in the even and then do a
eaAbort, but that does not work because the passed exeption goes out of scope and I get a invalid pointer error.
Please advise,
Snorkel
I have been using the script component as a work around for the inability of the query component to execute multiple commands and for the most part it works ok, except when a error occurs.
In most of my situations I have my own exception handler, for example
try
myscript.sql.add('some sql');
myscript.sql.add('some sql');
myscript.sql.add('somesql');
excute; //does not allow script exceptions to bubble up
modalresult:=mrok;
except
on e:exception do
showmessage(e.message);
end;
Because the script handles the errors it always executes the modalresult line, I tried using the scripts on error handler but it does not work the way I need it to.
The error handler would be ok if it had a option to abort and re raise the exception so the outside error handler picks up the exception.
I tried to re raise the exception that is passed in the even and then do a
eaAbort, but that does not work because the passed exeption goes out of scope and I get a invalid pointer error.
Please advise,
Snorkel