PDA

View Full Version : Maybe a bug found when testing using oracle 10g



mrobayo
10-11-2006, 10:06 AM
Hi,

Maybe, I found a bug when i'm testing with oracle10g, but i add a line to the function getQuoteIdentifierString, because Oracle consider that nonquoted identifiers must be refered always without double quotation.

But the aliases with spaces generate a sql-syntax error in the function nonDistinctGenerateSQL, so its necessary to add the quotes

With this changes it works fine, now.

Mario

mondrian.rolap.sql.SqlQuery.Dialect.getQuoteIdentifierString()
if (isDB2()) {
return "";
}
else if (isOracle()) {
return "";
}else {
return quoteIdentifierString;
}
}


mondrian.rolap.agg.AbstractQuerySpec.nonDistinctGenerateSQL()
...
if (sqlQuery.getDialect().isAS400()) {
sqlQuery.addSelect(expr, null);
} else {
if (sqlQuery.getDialect().isOracle()) {
sqlQuery.addSelect(expr, "\\"" + getColumnAlias(i) + "\\"");
}else {
sqlQuery.addSelect(expr, getColumnAlias(i));
}

}
...


Mario

jhyde
10-12-2006, 08:24 PM
I don't think this is a bug in Mondrian. Even though you defined them in lower case, your table and column names are upper case. Do 'select * from cat' and you'll see.

Mondrian quotes all identifiers so that Oracle gets them exactly as they are - same case, and including spaces, punctuation etc.

You should define the table and column names in the schema.xml file in upper case - then you won't need that code change, and everything will just work.

Julian