Re: selecting nvarchar with Oratcl?
- From: "thelfter@xxxxxxxxx" <thelfter@xxxxxxxxx>
- Date: Wed, 28 Nov 2007 06:59:11 -0800 (PST)
On Nov 28, 9:48 am, schl...@xxxxxxxxxxxxxxxx wrote:
thelf...@xxxxxxxxx wrote:
On Nov 28, 7:41 am, schl...@xxxxxxxxxxxxxxxx wrote:
Hello,
I'm afraid I'm not going to be much help to you, even though I'm
supposed to be able too.
The 'utfmode' flag tells the 'C' library to perform code similar to
the bottom.
1221 if (StmPtr->utfmode) {
1222 Tcl_ExternalToUtfDString(NULL,
1223 tmp,
1224 -1,
1225 &uniStr);
1226 tmp = Tcl_DStringValue(&uniStr);
1227 }
Which converts the values into the native system encoding?
Tcl_Encoding encoding (in)
The encoding to query, free, or use for converting text. If encoding
is NULL, the current system encoding is used.
There are others on this board, who have gotten NVARCHAR2 to work.
Hopefully they can reply.
Thanks Todd for the comment. Reading the OCI docs right now i find
that it probably is a wrong bind/define setup that breaks things. In
general its a mess...
If i see it correctly, it might be that one has to use
OCIEnvNlsCreate() to setup the environment...http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci15r...
(which would have the nice side effect that you could ignore the
client side setting of NLS_LANG and always set it to something
sensible like Tcls utf-8 encoding and remove the dependency on
environment vars for correct conversion).
After set one has to use some special value in binding or defining
values, but haven't quite figured it out yet, OCI docs tell me to use
this...
"If you do not know the target datatype, then you should set the
OCI_ATTR_CHARSET_FORM attribute to SQLCS_NCHAR when binding and
defining."
Maybe it helps, i have to do it for the python stuff right now, but if
it works i could take a look at the Oratcl code also...
Michael
Anything you can add would be appreciated. I do have some 'beta' code
that can use UCS2 mode that you could try.
As long as your varchar2()'s are smaller than 2000 characters, I've
run into no issues.
Try grabbing the oratcl CVS head. (will compile as version 4.5) and
instead of 'utfmode' try 'oraconfig $shandle unicode true'
=Todd
.
- References:
- selecting nvarchar with Oratcl?
- From: schlenk
- Re: selecting nvarchar with Oratcl?
- From: thelfter@xxxxxxxxx
- Re: selecting nvarchar with Oratcl?
- From: schlenk
- selecting nvarchar with Oratcl?
- Prev by Date: Re: tablelist: embed abutton in cells
- Next by Date: Can someone explain this performance issue?
- Previous by thread: Re: selecting nvarchar with Oratcl?
- Next by thread: Dangerous update command
- Index(es):