sasfvs icon

Untitled

sasfvs | PRO | 07/05/17 07:55:26 AM UTC | 0 ⭐ | 7338 πŸ‘οΈ | Never ⏰ | []
PL/SQL |

640 B

|

None

|

0 πŸ‘

/

0 πŸ‘Ž

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

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž