VARIABLE v_bind1 VARCHAR2(10); -- no block section no nothing, just a bind variable declaration EXEC :v_bind1 := 'hacker'; -- this is how you initialize the variable using the command EXEC (Execute) SET SERVEROUTPUT ON; BEGIN Β Β :v_bind1 := 'cracker'; -- second way of initialize END; / -- note the ":" -- Now let's display the bind variable value. In 3 different ways: Β -- 1. DBMS_OUTPUT package BEGIN Β Β :v_bind1 := 'cracker'; Β Β DBMS_OUTPUT.PUT_LINE(:v_bind1); END; Β -- 2. Print command PRINT :v_bind1; -- as a single command and also no blocks are needed Β -- 3. Using AUTOPROINT SET AUTOPRINT ON; - will print automatic AT initialization
Comments
0 B
|π
/π
0 B
|π
/π
0 B
|π
/π
0 B
|π
/π