OK, but how did you find out that Q1 = 11 instead of 11.5? What does DBMS_OUTPUT.PUT_LINE(Q1) and Q1 * 2 (if the column value = 11.5, then 11.5 * 2 = 23, right? If Q1 = 11, then the result will be 22) say? Did you perhaps set numformat 999 or something like that so that output fools you?
CREATE TABLE stock (
stock_id NUMBER(4) Not Null,
stock_Qty NUMBER(12,3) Not Null,
Parcel_Id NUMBER(4) Not Null
INSERT INTO stock VALUES (1, 11.5, 1);
CREATE OR REPLACE PROCEDURE p1 AS
WHERE parcel_id = 1;
DBMS_OUTPUT.PUT_LINE('The stock quantity is ' ||v_stock_qty);
set serveroutput on size 100000
And this is the output from the SQL
SQL> exec p1;
The stock quantity is 11.5
I have no idea what you are doing, but please check your work. You should not be having this problem.