Pl/SQL programming data type in Oracle pl Programming Data Type: www.2cto.com 1. scalar type (scalar) 2. composite 3. reference Type 4.lob( large object) -------------------------------------------------------------- case 1 of defining a scalar. defines a variable-length string v_ename varchar2 (10) 2. define a decimal number ranging from-9999.99 to 9999.99 v_sal number (6, 2) 3. define a decimal number and assign a value of 5.4: = To the pl/SQL value v_sal2 number (6, 2): = 5.4 4. define a date type of data v_hiredate date; 5. define a boolean variable. It cannot be empty. The initial value is false v_valid boolean not null default false; ---------------------------------------------------- the variable 1.pl/ SQL record 2.pl/ SQL Table 3 that stores multiple values. nested table 4. varray -------------------------------------------------------- reference variables are divided into: cursor variables and object variables case 1 Please use pl/SQL to write a block, you can enter the Department number and display all declare -- Define a cursor type chenchuang_emp_cursor is ref cursor; -- Define a cursor variable test_cursor chenchuang_emp_cursor -- Define the variable v_ename emp. name % type v_sal emp. sal % typebegin -- execute -- combine test_cursor and a select statement with open testr_cursor for select ename, sal from emp wheredeptno = & no; -- cyclically retrieve loop fetch test_cursor into v_ename, v_sal; -- determine whether testr_cursor is null exit when testr_cursor % notfound; dbms_output.put_line ('name' | v_name | 'wage '| v_sal); end loop; end;