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.

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.