Re: MS SQL Server Unicode Support
Re: MS SQL Server Unicode Support
- Subject: Re: MS SQL Server Unicode Support
- From: Chuck Hill <email@hidden>
- Date: Tue, 19 Sep 2006 14:27:45 -0700
For EOF, you can set the Read Format to N %P and the Write Format to
N %V for each attribute in the model. I'd expect this could just be
done on a prototype, but I have never done so.
Chuck
On Sep 19, 2006, at 2:02 PM, Dov Rosenberg wrote:
We are using Cayenne for some web services alongside our EOF based
application. Our application supports unicode formatted characters
in the database but in order to support it properly using MS SQL
Server apparently we need to change our data types from char,
varchar, text to nchar, nvarcahr, ntext. This is no big deal.
However in order to properly store the data into those fields and
to be able to query against them we need to preface all of the
strings with a N – this signals MSSQL Server to use the Unicode
encoding for that column. For example say we have a table:
CREATE TABLE "CONTENTDATA" (
RECORDID NVARCHAR(64) NOT NULL ,
XML NTEXT NULL ,
CONSTRAINT PK_CONTENTDATA PRIMARY KEY (RECORDID)
);
In order to insert unicode characters into that table I need to
generate a SQL statement like:
INSERT into CONTENTDATA (RECORDID, XML) values (N’1234ABC’,
N’<MYXML>....</MYXML>’);
Notice the N in front of the strings I am inserting. In order to
query on this table properly I need to add the N in front of the
WHERE clause pieces such as:
SELECT * from CONTENTDATA where xml like N’<MYXML>%’;
I only need to put the N when the data contains unicode characters
– but I really won’t know that so I probably need to do it all of
the time.
I am looking for the correct place in both cayenne and EOF to add
the N’ to the queries (INSERTs, and WHERE clauses). Any help or
suggestions would be HIGHLY appreciated.
BTW – it seems that Oracle can at least tolerate this unusual SQL
format. MSFT says that it is SQL 92 compliant but I haven’t found
anything documenting it yet.
--
Dov Rosenberg
Conviveon/Inquira
Knowledge Management Experts
http://www.conviveon.com
http://www.inquira.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden