Define varchar2 type variable : CHAR « Data Type « Oracle PL / SQL






Define varchar2 type variable

  

SQL>
SQL> set serverout on
SQL>
SQL> declare
  2      l_text varchar2(100);
  3    begin
  4      l_text := 'Hello, World!';
  5      dbms_output.put_line(l_text);
  6    exception
  7      when others then
  8        dbms_output.put_line('We encountered an exception!');
  9        raise;
 10    end;
 11    /
Hello, World!

PL/SQL procedure successfully completed.

SQL>
           
         
    
  








Related examples in the same category

1.The CHAR data type is used for storing fixed-length character strings.
2.char type with 50 characters
3.Comparison of CHAR with VARCHAR2
4.Define and use char value
5.set column width by setting char number
6.CHAR() and VARCHAR2()
7.'' represents a zero length character string BUT NOT a null value
8.No equality comparison between two '' strings
9.Compare char value without knowing the case
10.Convert string to clob
11.char type and varchar2 type
12.Memory allocation differences between the CHAR and VARCHAR2 datatypes