Hi, I've found (at least) 2  bugs with the SQL that Torque is generating
for Oracle.  I'm working with beta3 so if these have already been fixed for
beta4, please ignore.

First, if you try to use a BIGINT in your project-schema.xml declaration,
      type="BIGINT"
      size="15"
Torque will generate the following incorrect SQL,
      COLUMN_NAME (20, 0) (15) NOT NULL
Whatever size you choose in the xml, it will always ready "20, 0" inside
the paranthesis, and the true length will be outside, as seen above.  This
needs to be changed to produce the following
      COLUMN_NAME (15, 0) NOT NULL


Second, if you try to select rows based on a distinct column like thet
following:
      criteria.add(TablePeer.COLUMN_NAME, Criteria.DISTINCT);
you get the following completely invalid SQL:
      SELECT  FROM TABLE WHERE TABLE.COLUMN=1 AND
TABLE.OTHER_COLUMN=DISTINCT

There is only 1 way to do a distinct query in Oracle,
      SELECT distinct(column) FROM...

I haven't looked into this, but I'm assuming Torque has to select the whole
row to get the entire object, so just selecting distinct(column) won't work
very well.  The other options are to either fill in all the column names on
the select (which Torque should know), or to do a sub-select, that is
      select * from table where column = 1 and other_column in {select
distinct(other_colomn) from table}

Thanks!

Tobin Juday
Software Engineer
proud graduate of The Ohio State University
[EMAIL PROTECTED]
Phone: 614.564.4192
Pager: 877.546.0103

The #1 Way to Pay Online
http://www.checkfree.com/paybillsonline




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

Reply via email to