Subject | Re: [ib-support] Problem with stored procedure FB1.0.2 |
---|---|
Author | Martijn Tonies |
Post date | 2003-04-14T13:04:53Z |
Hi Dmitry,
it should contain NULL, right?
(I know that if it _has_ a value, it won't be touched if no rows are
returned).
--
Martijn Tonies
> > > The problem is that when the sql statement (eg.)is
> > > SELECT Stock FROM RESM_STOCK WHERE ItemIdx = :ItemIdx
> > INTO :StockQty;
> > > is executed in the procedure and there is no result for the current
> > ItemIdx,
> > > it containts the result of the previous select where ther
> > was a record for
> > > Itemidx.
> > > eg
> > > Select ... ItemIdx = 5 -> result 10
> > > Select ... itemidx = 1 -> (no record for it) return also 10
> >
> > I'm pretty sure it doesn't return "10" - what makes you think it does?
>
> Johan is absolutely correct. If there's no record to fetch, then nothing
> assigned to the variable/parameter (StockQty), so it still contains an oldEhm - one thing though. If the variable hasn't been used in this procedure,
> value. And it's not a bug, but as designed. The only way to handle it
> properly is initializing variable/parameter before SELECT and checking its
> value after it, i.e. exactly how Johan has done it.
it should contain NULL, right?
(I know that if it _has_ a value, it won't be touched if no rows are
returned).
--
Martijn Tonies