You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Christoffer Hammarström (JIRA)" <ji...@apache.org> on 2006/05/17 10:56:06 UTC

[jira] Created: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
----------------------------------------------------------

         Key: DDLUTILS-108
         URL: http://issues.apache.org/jira/browse/DDLUTILS-108
     Project: DdlUtils
        Type: Improvement

  Components: Core  
 Environment: Microsoft SQL Server
    Reporter: Christoffer Hammarström
 Assigned to: Thomas Dudziak 


I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.

I'll try to make a patch.

Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.

I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DDLUTILS-108?page=comments#action_12412129 ] 

Thomas Dudziak commented on DDLUTILS-108:
-----------------------------------------

There are several ways to support N* datatypes for Oracle, Sql Server etc.:

* A DdlUtils-wide useUnicodeDatatypes (or a similar name) setting, which directs DdlUtils to use the N* variant for CHAR/VARCHAR/LONGVARCHAR/CLOB wherever possible.

* A type override mechanism that allows to user to specify the native type. With this, you could specify NTEXT for a specific column.

* A encoding attribute for columns which may contain values like DEFAULT, UNICODE, but also specific encodings like LATIN1. The first two would have the same effect as the first solution above, but limited to this column. The other values might be used by databases that support setting the collation locale on the column level.

The first one can be implemented without much hassle (no need to create patch, I have it largely worked out on paper), but the other two require a change in the DTD and the model, and thus I won't be implementing them in the 1.0.

> Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
> ----------------------------------------------------------
>
>          Key: DDLUTILS-108
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-108
>      Project: DdlUtils
>         Type: Improvement

>   Components: Core
>  Environment: Microsoft SQL Server
>     Reporter: Christoffer Hammarström
>     Assignee: Thomas Dudziak

>
> I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.
> I'll try to make a patch.
> Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.
> I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Posted by "Christoffer Hammarström (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DDLUTILS-108?page=comments#action_12413715 ] 

Christoffer Hammarström commented on DDLUTILS-108:
--------------------------------------------------

By the way, on the mailing list you said:

"Most schemas that I have worked with, have used varchar instead of
nvarchar and rather set the database language to a specific value. So,
nvarchar would limit DdlUtils' usability even more. The only useful
solution would be the introduction of the notion of fully supported
unicode and non-unicode modes in DdlUtils."

I don't understand how always using N*-types would limit the usability of DdlUtils, given that an N*-type can store everything a non-N*-type can, only using double the space?
Going a bit anecdotal, i myself prefer to always use (say) NVARCHAR over VARCHAR, as i don't need to worry about the database not being able to store certain characters.

Are there any other arguments against always using NCHAR/NVARCHAR/NTEXT instead of their non N-variants?


> Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
> ----------------------------------------------------------
>
>          Key: DDLUTILS-108
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-108
>      Project: DdlUtils
>         Type: Improvement

>   Components: Core
>  Environment: Microsoft SQL Server
>     Reporter: Christoffer Hammarström
>     Assignee: Thomas Dudziak

>
> I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.
> I'll try to make a patch.
> Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.
> I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DDLUTILS-108?page=all ]

Thomas Dudziak updated DDLUTILS-108:
------------------------------------

    Fix Version: 1.1

> Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
> ----------------------------------------------------------
>
>          Key: DDLUTILS-108
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-108
>      Project: DdlUtils
>         Type: Improvement

>   Components: Core
>  Environment: Microsoft SQL Server
>     Reporter: Christoffer Hammarström
>     Assignee: Thomas Dudziak
>      Fix For: 1.1

>
> I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.
> I'll try to make a patch.
> Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.
> I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Posted by "Christoffer Hammarström (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DDLUTILS-108?page=comments#action_12412153 ] 

Christoffer Hammarström commented on DDLUTILS-108:
--------------------------------------------------

As far as i can see, there is no ddlutils-wide object to attach the setting to. Do you mean add such an object, or to add the setting to Platform?

Are you planning this any time soon-ish? I need it rather urgently, but if you won't accept any patches on this, i'll just maintain a local branch where i change the default MSSqlPlatform.

> Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
> ----------------------------------------------------------
>
>          Key: DDLUTILS-108
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-108
>      Project: DdlUtils
>         Type: Improvement

>   Components: Core
>  Environment: Microsoft SQL Server
>     Reporter: Christoffer Hammarström
>     Assignee: Thomas Dudziak

>
> I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.
> I'll try to make a patch.
> Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.
> I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DDLUTILS-108?page=all ]

Thomas Dudziak updated DDLUTILS-108:
------------------------------------

    Component: Core - SqlServer
                   (was: Core (No specific database))

> Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
> ----------------------------------------------------------
>
>          Key: DDLUTILS-108
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-108
>      Project: DdlUtils
>         Type: Improvement

>   Components: Core - SqlServer
>  Environment: Microsoft SQL Server
>     Reporter: Christoffer Hammarström
>     Assignee: Thomas Dudziak
>      Fix For: 1.1

>
> I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.
> I'll try to make a patch.
> Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.
> I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DDLUTILS-108) Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DDLUTILS-108?page=comments#action_12412163 ] 

Thomas Dudziak commented on DDLUTILS-108:
-----------------------------------------

> As far as i can see, there is no ddlutils-wide object to attach the setting to. Do you mean add such an object, or to add the setting to Platform? 

Yes, it would be a platform setting, in the same way as e.g. the delimited identifier setting is.

> Are you planning this any time soon-ish? I need it rather urgently, but if you won't accept any patches on this, i'll just maintain a local branch where i change the default MSSqlPlatform.

I can add option one to the 1.0 - as I said its not much work, mostly writing tests. The other two options have to wait though.

> Unicode text fields (NTEXT, NVARCHAR, and NCHAR) for MSSQL
> ----------------------------------------------------------
>
>          Key: DDLUTILS-108
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-108
>      Project: DdlUtils
>         Type: Improvement

>   Components: Core
>  Environment: Microsoft SQL Server
>     Reporter: Christoffer Hammarström
>     Assignee: Thomas Dudziak

>
> I need to be able to store (for example) the contents of http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt in an NTEXT field in an SQL Server database generated with ddlutils.
> I'll try to make a patch.
> Hibernate does it using another "dialect", which is analogous to a ddlutils "platform", if i understand correctly: http://confluence.atlassian.com/display/DOC/MSSQL+Tips#MSSQLTips-MSSQLandUnicode.
> I'm thinking of two possibilites: either a new platform like hibernate called something like "unicodemssql" (?), or some way to send a parameter into the MSSqlPlatform or MSSqlBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira