Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: pl/sql: Forgive me if this is stupid

Re: pl/sql: Forgive me if this is stupid

From: Jeff Landers <jlanders_at_convergys.com>
Date: Wed, 31 Jan 2001 10:48:08 -0500
Message-Id: <10758.127899@fatcity.com>


Koivu, Lisa wrote:

>
>
> but I can't figure out why this is executing the way it is.
>
> The code meets the criteria for executing the THEN statement. I step
> through it and watch it happen.
> However it then falls into the ELSE and decrements the index. It
> doesn't even delete the two records, it skips to line 10. I wrote the
> code to either execute THEN or execute ELSE...
>
> It may be pre-coffee boneheadedness, but I don't know why this is. If
> anyone has any insight or sees anything wrong with this, please speak
> up..
>
> Thanks everyone
>
> 1 IF (mtab_ps_price_range(mn_ps_index) <>
> mtab_pl_price_min(mn_pl_index)
> 2 OR mtab_ps_price_range(mn_ps_index) IS NULL)
> 3 THEN
> 4 mtab_ps_price_range(mn_ps_index) :=
> to_char(mtab_pl_price_min(mn_pl_index),'FM$9,999,999.00');
> 5 ELSE
> 6 -- Delete record, price hasn't changed.
> 7 -- Don't increment the product_search counter (pn_ps_index)
> 8 mtab_ps_prod_id.DELETE (mn_ps_index);
> 9 mtab_ps_price_range.DELETE (mn_ps_index);
> 10 mn_ps_index := mn_ps_index - 1;
> 11 END IF;
>
> Lisa Rutland Koivu
> Oracle Database Administrator
> Qode.com
> 4850 North State Road 7
> Suite G104
> Fort Lauderdale, FL 33319
>
> V: 954.484.3191, x174
> F: 954.484.2933
> C: 954.658.5849
> http://www.qode.com
>
> "The information contained herein does not express the opinion or
> position of Qode.com and cannot be attributed to or made binding upon
> Qode.com."

  Hi Lisa

  Perhaps the extra parenthesis will help.

       IF ((mtab_ps_price_range(mn_ps_index) <> mtab_pl_price_min(mn_pl_index))

          OR mtab_ps_price_range(mn_ps_index) IS NULL) Received on Wed Jan 31 2001 - 09:48:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US