PL/SQL Question: How to Assign a CHAR variable to a NVARCHAR2 variable
Date: Thu, 7 Nov 2002 12:19:35 -0700
Message-ID: <8fxy9.332$CP2.59461_at_wagner.videotron.net>
Hi there,
I'm new to PL/SQL (Oracle 8i) and I need to convert a DATE variable to Text
RETURN NVARCHAR2
RETURN sDate;
I tried to write the following code function:
AS
sDate NVARCHAR2(10);
BEGIN
sDate := TO_CHAR(TRUNC(SYSDATE), 'YYYY-MM-DD');
END;
PLS-00560: character set mismatch.
The NLS_LANG variable from the registry is AMERICAN_AMERICA.WE8ISO8859P1.
Is there another function in Oracle 8i to return the date as a NVARCHAR2 or
is there a way to convert a CHAR to a NVARCHAR2. If not how can I convert
from one character set to another (CAST and CONVERT doesn't seem to work).
PS: Its mandatory that the date is returned as a NVARCHAR2 in 'YYYY-MM-DD'
format.
Thanks you for your help.
J.B. Fidelia
Received on Thu Nov 07 2002 - 20:19:35 CET