db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Monroe" <Greg.Mon...@DukeCE.com>
Subject RE: XML Entities in Table Names
Date Tue, 04 Mar 2008 15:53:09 GMT
The basic problem here is that in order for Torque to 
produce code and tables across the many Database server
it does, it has to adhere fairly closely to the SQL 

The standards define that "regular identifiers" (e.g. 
column and table names) must consist of basically the 
same characters as a Java variable name and the XML 
identifier rules. So, the Torque limits these 
identifiers to this set. This means that the tables 
and columns in the XML schema definitions will be 
creatable in all the DB servers supported by Torque.

So, this error is saying telling you that the table or 
column name is not truly cross DB server compatible. If 
you want a DB schema design that is able to be use on 
any DB, use a different name.

That said, if you don't want true cross DB names, you 
MIGHT be able to get a little wiggle room in names by
using hex identifiers in the XML E.g. &X##; for SOME
of the characters.  This may get around the XML parser
limits.  You'll probably need to make sure you have
javaname attributes set in the XML to make the code work.

FWIW, there is a part of the standard that allows for
delimited identifiers. E.g., "Non#Standard#char". 
However, Torque currently does not support these. In 
addition, different DB server types have variations 
on this that make cross DB table names of this sort

> -----Original Message-----
> From: Leo Przybylski [mailto:przybyls@arizona.edu]
> Sent: Saturday, March 01, 2008 12:01 AM
> To: torque-user@db.apache.org
> Subject: XML Entities in Table Names
> Hash: SHA1
> Hello all,
> I'm new to the list. I tried searching for the answer to my question
> the internet, but I can't seem to find it. Maybe I am asking the wrong
> question, but here it is.
> I am using torque to copy one database to another. For example, Oracle
> to Oracle, or Oracle to MySQL. There is no way to know the source or
> target. Torque doesn't seem to care, and that's what I like about it.
> Some RDBMS allow strange characters that are XML entities in the name.
> For example, Oracle will allow something like DEPT$SECTION or
> like that. '$' causes problems in XML. Torque produces the following
> error as a result:
> [torque-data-dump] org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An
> invalid or illegal XML character is specified.
> What can I do to get around this? I am not opposed to entity
> translation
> in XML (ie., <DEPT_DDOLLAR_SECTION ... /> where DDOLLAR replaces $,)
> but
> how would I go about that?
> Much thanks in advance,
> - --
> Leo Przybylski
> Application Systems Analyst, Senior
> Department of Sponsored Projects Services
> The University of Arizona
> Tucson, AZ 85701
> Office: 520.626.6997
> E-mail: przybyls [at] u.arizona.edu
> URL: http://www.u.arizona.edu/~przybyls/,
> https://test.kuali.org/confluence/display/~lprzybylski
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> G3kqrMhCQ4L2Lsne+2kYAYo=
> =Df79
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org

DukeCE Privacy Statement:
Please be advised that this e-mail and any files transmitted with
it are confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity
to whom they are addressed. If you are not the intended recipient
you may not rely on the contents of this email or any attachments,
and we ask that you please not read, copy or retransmit this
communication, but reply to the sender and destroy the email, its
contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is
strictly prohibited.

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

View raw message