But, Mike, maybe I'm not seeing it but Javier's suggestion - sorry, Javier, this isn't meant to be a criticism - excluded the error variable line. That's what I was trying to get at:
SET ERROR MESSAGE 2378 OFF INSERT INTO vref pr_nbr vn_id vn_unitp vn_ltrns VALUES + .prnbr, .vnid, .unitp, .trdate SET ERROR MESSAGE 2378 ON The insert may or may not work but the error variable doesn't get set immediately after the insert command - whether or not the error message is on or off. Anyhow, Dennis's problem was the message appearing even though it's been turned off first. Regards, Alastair. ----- Original Message ----- From: "MikeB" <[EMAIL PROTECTED]> To: "RBG7-L Mailing List" <[email protected]> Sent: Monday, June 06, 2005 5:36 PM Subject: [RBG7-L] - RE: Unable to suppress error messages? > > > > If SET ERROR MESS #### ON is run won't the error variable be for that > > command? > > Yes. That is the reason for the intermediate variable vHoldErr, to catch the > value of vERR before any Other command causes the error value to be set to that > actions result. > > > > Regards, > > Alastair. > > >> Even with: > >> > >> Set mess XXXX Off > >> > >> The error variable still holds the value of the err mess Like > >> > >> > >> Set error var verr > >> set var vHoldErr int = null > >> > >> Select somecol from someTable wher someCol = 'SomeValueNotThere' > >> set var vHoldErr = .verr > >> > >> > >> The value of vHoldErr is 2059, so you can still check for error even with > > the > >> message suppressed from the GUI. > >> >
