tailieunhanh - Oracle Built−in Packages- P100
Oracle Built−in Packages- P100: Ah, for the good old days of Version of PL /SQL! Life was so simple then. No stored procedures or functions and certainly no packages. You had your set of built−in functions, like SUBSTR and TO_DATE. You had the IF statement and various kinds of loops. With these tools at hand, you built your batch−processing scripts for execution in SQL*Plus, and you coded your triggers in SQL*Forms , and you went home at night content with a good day's work done. | Appendix A What s on the Companion Disk The function Available first in PL SQL8 this function allows you to retrieve the value of a database initialization parameter set in the initialization file . Here s the header FUNCTION parnam IN VARCHAR2 intval IN OUT BINARY_INTEGER strval IN OUT VARCHAR2 RETURN BINARY_INTEGER The value returned by the function is either of the following 0 Indicating a numeric or Boolean parameter value 1 Indicating a string parameter value Parameters are summarized in the following table. Parameter Description parnam The name of the initialization parameter case-insensitive . intval The parameter value if that value is numeric. If the value is a Boolean . the value in the initialization file is TRUE or FALSE then intval is set to 0 for FALSE and 1 for TRUE. If the value is a string then this argument contains the length of that string value. strval The parameter value if that value is a string. Otherwise it is NULL. Long desired by Oracle developers the GET_PARAMETER_VALUE function now allows you to get critical information about the current database instance including the default date format and lots of information about the way shared memory is configured. And you don t have to use UTL_FILE to read the initialization file. Chances are your DBA would not enable the database directory holding this file for UTL_FILE access anyway . Note that if you have more than one entry for the same parameter certainly a possibility with a parameter such as UTL_FILE_DIR then this built-in will retrieve only the value associated with the first occurrence of the parameter. You will probably want to build a wrapper around GET_PARAMETER_VALUE to make it easier to retrieve and interpret the results. Why Whenever you call this built-in function you must declare two variables to retrieve the OUT arguments. You must then interpret the results. Rather than write all this code
đang nạp các trang xem trước