Re: SQLCA.SQLCODE = NOTFOUND, STATUS = 0 ?
Posted in 1995
In article <3tkl6t$rtr@cssun.mathcs.emory.edu> jgordon@us.DHL.COM "Jim Gordon" writes: > On Jul 7, 11:03pm, Bashir Akram wrote: > > Subject: SQLCA.SQLCODE = NOTFOUND, STATUS = 0 ? > > One of our programs is doing a fetch (the select below), > > sqlca.sqlcode = NOTFOUND but STATUS = 0, so rather > > than checking on STATUS we have to check on sqlca.sqlcode. > <snip> > > sqlca.sqlcode records the status from the last SQL statement executed. > status records the status from the last statement executed. Therefore at our site we always (one hopes!) use the following: some-SQL-statement LET rtcd = STATUS CASE ( rtcd ) .... Non-SQL statements reset STATUS in some versions and not in others. Since we write a product ported to many machines & versions the above is a safe way to do things. NB define 'rtcd' as INTEGER -- ============================================================================ Sally Woolrich | This mail contains my personal sally@excelsis.demon.co.uk | views not those of my employer! ============================================================================