Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> OCI: I18N and storing wide char data

OCI: I18N and storing wide char data

From: Mark Crosland <mjc_at_c1000907-b.sttls1.wa.home.com>
Date: Mon, 04 Dec 2000 04:50:35 GMT
Message-ID: <slrn92m8kp.882.mjc@c1000907-b.sttls1.wa.home.com>

Hello,

We are developing an OCI based C++ application that requires internationalization support. One of the things we will do is to shuffle character data around using wchar_t* (instead of char*) and wstring (instead of string).

We are currently using 8.1.6 on HPUX 11.00.

I noticed the nvarchar2 and nchar data types, which appear to tailored to storing wide character (or multibyte?) character data. So, as a simple test I came up with a table that has an nvarchar2 in it and a sql statement that looks like

insert into tbl values ( :placeholder )

static sb2 indicator;
static wchar_t wc[20];
mbstowcs(wc,"hello",6);
if (OCIBindByName(

			m_stmt,

&m_bindHandle,
m_dbPtr->ociErr(), (text *)":placeholder", -1, (dvoid *)wc, 10, SQLT_STR,
&indicator,
0,0,0,0,OCI_DEFAULT) != OCI_SUCCESS) { printf("bind failed\n");

}

The bind succeeds.

When I execute the statement I get the following error code

ORA-12704: character set mismatch

I also tried SQLCS_NCHAR instead of SQLT_STR in the bind statement.

Also, not sure what data type I should be binding, a "multibyte" char*, a wchar_t* ?

The OCI docs are lacking in this area,
or I missed something, several times :)

Clues appreciated...

Mark, Received on Sun Dec 03 2000 - 22:50:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US