6.5 The Predefined DatatypesThe PLV package provides several centrally located, predefined datatypes. These elements are used throughout PL/Vision, but you can make use of them as well. The two variables that are to be used as predefined datatypes are the following: plsql_identifier VARCHAR2(100) := 'IRRELEVANT'; max_varchar2 VARCHAR2(32767) := 'IRRELEVANT'; Use the plsql_identifier variable whenever you need to declare a VARCHAR2 variable or constant that holds a PL/SQL identifier, such as a table name or column name or program name. Currently these names are limited to 30 characters. That may, however, change in the future and you will find errors popping up in your utilities if you declare variables like this: v_table_name VARCHAR2(30); Instead, use the predefined datatype as follows: v_table_name PLV.plsql_identifier%TYPE; Use the max_varchar2 variable whenever you need to declare a string variable to the maximum number of characters allowable in PL/SQL . Again, today that maximum size is 32,767, but this value may increase in the future. By relying on max_varchar2 in your declarations and parameter definitions, you (or the supplier of PL/Vision) can change the definition in one place and, with a compile, upgrade all your code.
Copyright (c) 2000 O'Reilly & Associates. All rights reserved. |
|