0

Well this is what I have done so far I ran these 2 lines first, they worked:
VARIABLE g_total NUMBER
VARIABLE g_prod NUMBER
Next I ran these 4 lines and they worked:
BEGIN
:g_total := 100;
:g_prod := 4;
END;
Then I ran these and that is when the problems started.

DECLARE
lv_qty_num NUMBER(3) := 0;
lv_amt_num NUMBER(5,2) := 0;
lv_price_num bb_product.price%TYPE;
BEGIN
SELECT price
INTO lv_price_num
FROM bb_product
WHERE idProduct = :g_prod;
WHILE lv_price_num < (:g_total-lv_amt_num) LOOP
lv_price_num := (:g_total-lv_amt_num);
END IF;
I know I have nothing to be seen but I would hope for the code to execute, Please someone could you give me a hint of where I am going wrong? Thank you.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by davidchilders
0

I think we need more details in order to help.

For example - you initialize your variable to the of 4

Is there an entry for idProduct that matches the value of 4?

Also - and perhaps most importantly - what is the exact error message you are receiving? A copy and paste of that message would be most helpful.

Thanks!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.