|
I think I have error dates handled now:
Where @@@@@@@@@@ is a placeholder for the library, in the RPG
program that generates the SQL source member for the UDF, I now have
with the new lines marked):
DROP FUNCTION @@@@@@@@@@/DISPLAYDAT;
create function @@@@@@@@@@/DISPLAYDAT(i_date NUMERIC(8))
returns DATE
language sql deterministic not fenced set option datfmt=*ISO
begin
declare continue handler for sqlexception /**NEW**/
return date('99991231000000'); /**NEW**/
if i_date = 0 then return date('00010101000000'); end if;
return date(digits(i_date) concat '000000');
END
What I know about handlers wouldn't buy you a cup of coffee, so is
there any reason why this handler would create a problem? Am I
correct in my understanding that a handler's scope is confined to the
innermost BEGIN block in which it resides? That it can't leak out and
wreak havoc with exceptions elsewhere?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.