2022-01-10

PL/SQL : "ORA-01008: not all variables bound"

I tried to run and execute the following block :

declare 
    sql_query varchar2(100);
    i number;
begin
select script into sql_query from formula_script where id = 1;
EXECUTE IMMEDIATE 
            'select ' || sql_query || ' from dual' into i; 
end;

sql_query is a cell with varchar2 datatype with this value : '1 - 1 * &c'

but couldn't get the result and it had the following error :

Error report -
ORA-01008: not all variables bound
ORA-06512: at line 6
01008. 00000 -  "not all variables bound"
*Cause:    
*Action:

and when I run the following code, It hasn't any error:

select 2*4 + &c from dual; 

thank you for your helping!



from Recent Questions - Stack Overflow https://ift.tt/3Gd9T6j
https://ift.tt/eA8V8J

No comments:

Post a Comment