Yes - the second block won't compile! Perhaps you meant:
declare
v_name table1.name%type;
v_value table1.value%type;
begin
v_name:='123';
EXECUTE IMMEDIATE 'select value from table1 where name='''||v_name||'''' into v_value;
end;
/
... in which case the answer is that there will be negligible difference for such a small program, but that the first is MUCH better than the second as a general approach, or if the code is to be invoked MANY times with different values of v_name. This is because the first uses BIND VARIABLES.
The second could also be re-written to use bind variables:
declare
v_name table1.name%type;
v_value table1.value%type;
begin
v_name:='123';
EXECUTE IMMEDIATE 'select value from table1 where name=:x' into v_value USING v_name;
end;
/
But the first block still has the edge performance-wise, because it doesn't parse the statement each time it is called.