The national character set is a shorthand notation that you can
use for a character set of your choice. SQL uses the national
character set for the following elements:
o For all columns and domains with the data type NCHAR or NCHAR
VARYING and for the NCHAR data type in a CAST function. For
information about these data types, see the Data_Types HELP
topic.
o For all parameters in SQL module language with the data type
NCHAR or NCHAR VARYING.
o For all character string literals qualified by the national
character set; that is, the literal is preceded by the letter
N and a single quotation mark (for example, N'). For more
information, see the Literals HELP topic.
You can specify the national character set at the session and
database level. See the Oracle Rdb Introduction to SQL and the
Oracle Rdb Guide to Database Design and Definition for more
detail about session and database character sets.
You specify the national character set for a database when you
create the database. You cannot alter the national character set
of a database.
SQL uses DEC_MCS as the national character set, unless you have
set the dialect to MIA or specified a national character set at
the session level. You can override any national character set
by specifying another national character set when creating a
database.
When you compile SQL programs (either SQL module language or
precompiled SQL), SQL uses the following to derive the national
character set:
o The NATIONAL CHARACTER SET clause in the DECLARE ALIAS
statement specifies the national character set of the alias
at compile time. It controls the national character set for
column and domain definitions and the NCHAR and NCHAR VARYING
data types in a CAST function. At run time, SQL uses the
national character set of the attached database for these
elements.
o The NATIONAL CHARACTER SET clause of the SQL module header
and the DECLARE MODULE statement specifies the character set
for literals qualified by the national character set and for
parameters defined with the data type NCHAR or NCHAR VARYING.
o In dynamic SQL, the SET NATIONAL CHARACTER SET statement
specifies, at run time, the character set for columns with
the data type NCHAR and NCHAR VARYING and for character string
literals qualified by the national character set.
o The RDB$CHARACTER_SET logical name. However, the logical name
is deprecated and will not be supported in a future release.
NOTE
Although SQL does not require that the national character
set of the database and the module match, Oracle Rdb
recommends that you define both with the same character
set.