tailieunhanh - Oracle Built−in Packages- P95
Oracle Built−in Packages- P95: 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 r_lower a z Create a raw string of uppercase followed by lowercase letters r_upper_lower r_upper r_lower Create a raw string of lowercase followed by uppercase letters r_lower_upper r_lower r_upper Translate upper to lower and lower to upper for the input string r_out r_in r_upper_lower r_lower_upper Convert the result back to varchar2 and return the result return r_out END Sample output follows SQL select switch_case This Is A Test from dual SWITCH_CASE THISISATEST tHIS iS a tEST The function The TRANSLITERATE function translates bytes in the input raw sting r substituting bytes found in from_set with positionally corresponding bytes in to_set. The translated string is returned. Bytes in r that do not appear in from_set are not modified. If from_set is longer than to_set then the unmatched bytes in from_set are right-padded with the pad byte. The return string is always the same length as the input string r. The specification follows FUNCTION r IN RAW to_set IN RAW DEFAULT NULL from_set IN RAW DEFAULT NULL pad IN RAW DEFAULT NULL RETURN RAW TRANSLITERATE is similar to TRANSLATE but it differs in that the return string is always the same length as the input string r . TRANSLITERATE is just like TRANSLATE if to_set and from_set are the same length. If from_set is longer than to_set then to_set is right-padded with the pad byte. TRANSLITERATE allows NULL from_set to_set and pad parameters. Parameters are summarized in the following table. Parameter Description r Input string to be translated from_set The list of bytes to be translated the default is 0x00 through 0xFF to_set The list of bytes that from_set bytes are translated to the default is NULL pad If from_set is shorter than to_set then this pad byte is the translation character for any .
đang nạp các trang xem trước