Hi all,
Thanks to Thomas Anhaus efforts the problem is solved.
The simple example of this behaviour could be:
CREATE DBPROC sp_name(IN PARAMETER_NAME VARCHAR(20)) AS
VAR M_VAR_NAME VARCHAR(20);
M_REC_COUNT FIXED(20);
TRY
/* check if asset exists */
SELECT COUNT(REC_ID)
FROM "MY_USER"."TABLE_NAME"
WHERE ID_FIELD = :PARAMETER_NAME;
FETCH INTO :M_REC_COUNT;
IF M_REC_COUNT = 0 THEN
STOP(10001, 'Record doesnt exists');
...
....
....
CATCH
/* handling fatal errors */
STOP($RC, 'Unexpected error');
As you can see - in my stored procedure I tried to raise error 10001.
But as Thomas stated - this error code has already a meaning
in the SAP DB kernel.
The solution - suggested by Thomas - is very simple- using
other error code - let's say "safe" one -i.e. from range -30 000 ; -31 000
Now it works perfectly.
And as You can see - it wasn't about DELETE statements- just
coincidence.
Thomas said this bug will be fixed ASAP.
Anyway - for me is another, very good example of the very high
level of support that people from SAP AG give us. And just for free.
I have some experiences with other supports -
offered for commercial products.Believe me or not - the quality of this
expensive
services isn't any better than the interest and acitivity of SAP DB
developers.
Thank you :)))
Marcin Pytel
U�ytkownik "Marcin P" <[EMAIL PROTECTED]> napisa� w wiadomo�ci
news:[EMAIL PROTECTED]
> Yes, You are right.
> This simple example works perfect even on my side.
> But in case of more complicated procedures something
> goes wrong.
> I wouldn't like to send the definition of my DB PROC
> to this mailing list as it is rather long, but I could send it to you in
> case
> you would like to take a look.
> For me these error is more general, because I've found it isn't
> connected only to delete statements - it has to be something with
> raising errors is DBPROC's, because now event simple
> STOP(1234,'First error') placed on the first line after TRY
> doesn't work as expected (does nothing). What's more - every
> other statement I try to execute later is causing an error "Communication
> link failure, session released".
> Thomas Anhaus (from SAP) promised to give it a little trial,
> so maybe in the near future he will be able to tell us a little
> more about possible reason for that behaviour.
> Anyway I will make some more investigations during weekend and
> post a message to this group if I find somethinng interesting.
>
> Regards,
>
> Marcin Pytel
>
>
> U�ytkownik "Janusz Jeczmionka" <[EMAIL PROTECTED]> napisa� w wiadomo�ci
> news:[EMAIL PROTECTED]
> >
> > Hello,
> >
> > In my opinion it shoud work as you expected. For me it works fine
> > (7.4.3.14 and 7.3.0.32). But in the case no error shoud be returned but
> > SQL_NOT_FOUND (100) (not an error). Of course no such info will be
> > returned if you declare dbproc as:
> >
> > create dbproc test( in id integer ) as
> > try
> > delete from test.test where id = :id;
> > catch
> > return;
> >
> > instead of:
> >
> > create dbproc test( in id integer ) as
> > try
> > delete from test.test where id = :id;
> > catch
> > stop( $rc, $errmsg );
> >
> > Bye
> > Janusz
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general