on 02-26-2013 2:17 PM
Hi,
I am attempting to create a procedure that has an exit handler in the repository but the validator will not allow the following syntax
declare exit handler for sqlexception SELECT -500, 'cannot drop table' FROM DUMMY
incorrect syntax near .... error at qp_gram.y:34124
for example:
create procedure yana_coding.model_i2c_cleanup
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
BEGIN
declare exit handler for sqlexception SELECT -500, 'cannot drop table model' FROM DUMMY
begin
drop table model;
end;
END;
Seems the repository validator will not allow me to use this function. Any other solution to capture errors?
Steven.
Hi Steven,
the general assumption for repository objects is that they will be read-only.
SQLScript procedures are meant as a means of code re-usability for processing steps, that are required in several models.
As exceptions are very often used for cases, where data gets modified, this feature is not available for SQLScript in repository objects.
You can either create this code outside your repository (with the need to organize the transport of the code yourself) or pass on the usage of exception handlers.
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exception handling is history! I just have to write better code
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exception Handling has just been introduced and not even fully documented, let's not kill it so soon .
I am very sure soon all the features, you are currently struggling with, will be made available for the repository objects (it is a wishlist item).
Thanks for bringing out all the issues so far, it has been a good learning.
Regards,
Ravi
Well as general rule exception handling is a general requirement in any modern programming environment. Even with read-only data, errors can happen. Being able to handle this in a elegant manner is way better then giving the user a "[SAP ERROR 209... ....]". It's about building a robust environment and having the tools available for that.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.