Search notes:

SQL*Plus: EXECUTE

execute (or its abbreviation exec) embeds the given text into a begin … ; end; block (note the ; after the replaced text) and executes it.
exec dbms_output.put_line('Today is ' || to_char(sysdate, 'yyyy-mm-dd'))
exec can be used to assign a value to a bind variable:
variable num number
exec :num := 42
select * from xyz where id = :num; 
Using execute does not change SQL*Plus' buffer.

Peculiarity

If the init parameter nls_length_semantics is set to byte, then using exec to assign a text value to a bind variable truncates it to the length of the variable:
SQL> alter session set nls_length_semantics=byte;
SQL> var txt varchar2(5)
SQL> exec :txt := 'hello world'
SQL> print txt

TXT
--------------------------------
hello
Trying the same in SQLcl results in ORA-06502: PL/SQL: value or conversion error: character string buffer too small.

See also

The slash «command».
SQL*Plus

Index