Oracle PL/SQL Tutorial/Conversion Functions/TO SINGLE BYTE
Версия от 13:45, 26 мая 2010; (обсуждение)
Convert that multibyte representation back to a single byte
SQL> DECLARE
2 g_one_byte NVARCHAR2 (1 CHAR) := "G";
3 g_three_bytes NVARCHAR2 (1 CHAR);
4 g_one_again NVARCHAR2(1 CHAR);
5 dump_output VARCHAR2(30);
6 BEGIN
7 g_one_again := TO_SINGLE_BYTE(g_three_bytes);
8 DBMS_OUTPUT.PUT_LINE(g_one_again || " is " ||TO_CHAR(LENGTHB(g_one_again))|| " byte again.");
9 END;
10 /
PL/SQL procedure successfully completed.
SQL>