Recognizing SQLNOTFOUND in store procedures
Posted in 1995
I have some trouble with store procedure working on OnLine 5.01 ( with Hebrew support ). How can I recognize a situation in store procedure in case a simple SELECT statement returns NOTHING ? It looks like sqlca.sqlcode == SQLNOTFOUND ( embedded C ) , but there is not sqlca in store procedure( SQL ). I'm trying to initialize a variable before SELECT , but after SELECT's execution I have a 'garbage' in this variable. E.g. The simple demo is , Remark : I don't want to use JOIN ! DEFINE contr INTEGER; DEFINE u_name CHAR(15); FOREACH SELECT ufd INTO u_name FROM usermaster LET contr = NULL; SELECT contract INTO contr FROM customers where username=u_name; IF contr is NULL THEN RETURN "NOT FOUND" with RESUME; ELSE RETURN "FOUND" with RESUME; END IF END FORTEACH Thanks a lot. You can access me : E-mail : valery@milcse.cig.mot.com Phone : (972)-3-6969560 at home ; (972)-3-5658494 at work ; -- ----------------------------------------------------------------- Valery Azbel E-mail : valery@milcse.cig.mot.com Phone : (972)-3-6969560 at home ; (972)-3-5658494 at work ; -----------------------------------------------------------------