Re: Returning SQLCA values: How?
Posted in 1996
> update mytable > set myfield = myvariable > where mykeyfield = passed_arg. > > If no rows are found to match my argument, this is not considered an > error, but shouldn't SQLCA.SQLCode be = 100? Irritating, isn't it? No, in an UPDATE or DELETE, there is no "notfound" concept. SQLCA.SQLERRD[2] (or maybe [3] - I'm at home as I write this) contains the number of records affected by the UPDATE or DELETE. > Or the other case, if the update works, is there any way to return the > number of rows that were updated? > > I guess the short question is, how do I get values from SQLCA in my > stored proc so I can return them to a user? Sorry, I don't know PowerBuilder, but surely if you can get access to SQLCA.SQLCODE, you can get access to the rest of SQLCA? I know it doesn't help you, but V6 or greater has a builtin function called dbinfo() which will help you. Good luck. -- Ciao, Billy +------------------------------------------------------------------------------+ | Billy Wheeler Junior Programmer / Director The West Solutions Group | +------------------------------------------------------------------------------+ | Oracle isn't the answer. Oracle is the question, and the answer is "no". | +------------------------------------------------------------------------------+