Vadim Gritsenko wrote:
As you might know, in default Oracle install,

    VALUE VARCHAR(20)

actually means 20 *bytes*, not 20 characters. So for i18n applications this means that actual limit is closer to 10 or less characters - depending on encoding. Since Oracle9 it's possible to specify that when you create a character field of specified length you actually *do* mean that this length is in characters, not bytes! New syntax is:

    VALUE VARCHAR(20 CHAR)

Alternatively, one can use NVARCHAR, which is (AFAIU) will always use UTF-16 encoding and length is always in characters, not bytes.

Questions,

* Is there a way to instruct torque to create schema using above syntax?

To my knowledge, Torque does not have switchable syntax like this. You should really ask Thomas Fisher and the others over at torque-dev or torque-user, since I'm not a Torque expert.

* Is there a way to instruct torque to use nvarchar instead of varchar?

As we've seen in OJB 1.0.2, it's possible to patch Torque templates to accomplish this. But that's a really ugly solution IMO and just a temporary work-around for the outdated Torque in 1.0.x branch.

Any Torque changes should be brought up for discussion with the Torque
developers and integrated in their trunk.

I felt really "dirty" when starting the patching bussiness here, that is
not what I consider a clean open source-move. If it would have been the
latest Torque we would not have done it, but would have submitted patches
to torque-dev instead.

  * Should OJB default to creating schema with length in characters instead
    of creating schema with length in bytes?

Don't think this is a good idea, since I think most users coming from the "RBDMS-world" will expect bytes as usual with CHAR. However, with OJB I might be wrong and people might be more "Java-world" centered and expect Java Character behaviour. I guess this should be polled on the user list to get an impression from the user base.


OJB is moving away from Torque to the new DB Apache Project "DdlUtils", which is Jakarta Commons-SQL moved out of the Jakarta Sandbox. The long-term plan is that both Torque and OJB will us DdlUtils for SQL-generation.

Tom has more info on this.

Directly to Tom: Is it possible to switch the generated default datatype in
DdlUtils? Eg could Vadim's wish of NVARCHAR instead of CHAR be accomplished
through property-changes or similar?

Regards,
 Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to