set serveroutput on
DECLARE
statement VARCHAR2(4000);
BALANCING_ID INTEGER;
VAULT_TILL_ID INTEGER;
balancingid INTEGER := 16437;
BEGIN
statement := 'SELECT EOD_BALANCING_ID, VAULT_TILL_ID
FROM MBCUSR2UT2.CASH_BALANCING
WHERE eod_balancing_id = :balancingid';
EXECUTE IMMEDIATE statement
INTO BALANCING_ID, VAULT_TILL_ID;
DBMS_OUTPUT.PUT_LINE('ID: ' || BALANCING_ID || ', Vault: ' || VAULT_TILL_ID);
END;
I have this query and it is not working due to error in line
WHERE eod_balancing_id = :balancingid
saying
Error report -
ORA-01008: not all variables bound
ORA-06512: at line 10
01008. 00000 - "not all variables bound"
*Cause:
*Action:
but when I use directly like
WHERE eod_balancing_id = 16437';
it is working fine why is it not working?