db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: Unicode support for varchar
Date Sat, 22 Nov 2003 01:16:21 GMT
I see.  I suggest changing Torque to add support for this patch which adds an 
encoding attribute to the <column> element:

Index: database.dtd
===================================================================
RCS file: /home/cvs/db-torque/src/generator/src/dtd/database.dtd,v
retrieving revision 1.3
diff -u -r1.3 database.dtd
--- database.dtd        3 Nov 2003 06:37:27 -0000       1.3
+++ database.dtd        22 Nov 2003 01:14:52 -0000
@@ -114,6 +114,7 @@
    scale CDATA #IMPLIED
    default CDATA #IMPLIED
    autoIncrement (true|false) "false"
+  encoding CDATA #IMPLIED
    inheritance (single|false) "false"
    inputValidator CDATA #IMPLIED
    javaNamingMethod (nochange|underscore|javaname) #IMPLIED

If not specified, encoding would have no effect.  If "UTF-8", data types like 
NVARCHAR would be used for platforms like MS SQL.  Interested in trying your 
hand at a patch to the generator?  Martin's recent introduction of the Platform 
classes ought to make this pretty easy.

- Dan


CHIU YEE WEAY wrote:
> Greetings Dan,
> 
> There are times where we only want to have certain varchar columns in a
> table to support unicode, but not all, due to the size. Thus, the missing
> of a property to indicate the unicode support for a column in the XML
> schema, will not allow me to know whether tha native data type to use is
> varchar or nvarchar (in mssql case). The default will always be varchar.
> 
> A simpler example for illustrating my problem will be : Let say, I have a
> nvarchar column in a table in mssql. When I generate the XML schema for
> this table, the column will always be in VARCHAR. When I use the
> generated XML schema to come out for the database creation scripts in
> mssql, it will always give me as varchar, instead of the expected
> nvarchar, as no attributes in the schema to indicate this is, in fact, a
> nvarchar column.
> 
> Or is there any workaround that you can think of ?
> 
> Chiu Yee Weay
> Systems Engineer
> Paradigm Systems Sdn Bhd
> 
> Quoting Daniel Rall <dlr@finemaltcoding.com>:
> 
> 
>>Chiu Yee Weay wrote:
>>
>>>Greetings,
>>>
>>>I would like to know how can we indicate a varchar column to support
>>>Unicode characters in the schema ? This would be something like the
>>>nvarchar column in MS SQL Server. Anyway, the standard JDBC type
>>
>>doesn't
>>
>>>have any special data type to differentiate between the non-Unicode
>>
>>or
>>
>>>Unicode varchar column. Perhaps we need an additional attribute for
>>
>>the
>>
>>><column> element in the schema to indicate this, e.g.
>>>unicode="true|false".
>>
>>Hi Chiu.  Any particular reason why you suggest per-column, rather than
>>
>>per-table or per-database?  The property could be ignored for columns
>>where it 
>>isn't applicable.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message