Joined: Sat Dec 02, 2006 1:09 am Posts: 12
|
I'm doing a native SQL query against Oracle and the query object says there are no return results but when I do query().list(), I get info that there is an array of chars with one row.
Can anyone tell me why I am getting a single char back? I have a copy of my query below.
I am doing the following:
Query query = session.createSQLQuery(sql);
query object says 0 for "queryReturns" if you put it in a watch
but
List list = query.list() says there is an arrayList of chars. The char returnd is 'X'.
If queryReturns says there are 0 in the query object should there not be 0 rows in the list returned? confusing.
---
String sql =
"SELECT COLLISION_FLAG"
+ " FROM (SELECT 'XCS_COLLISION_FLAG' as COLLISION_FLAG"
+ " FROM CIE.SYNC_QUEUE"
+ " WHERE Rdo_Typ = '" + rdoType + "'"
+ " AND Rdo_Key = '" + rdoKey + "'"
+ " AND Rdo_Change_Gmt >= sysdate - 3"
+ " UNION ALL"
+ " SELECT 'YCS_COLLISION_FLAG' AS COLLISION_FLAG"
+ " FROM CIE.SYNC_TASK"
+ " WHERE Rdo_Typ = '" + rdoType + "'"
+ " AND Rdo_Key = '" + rdoKey + "'"
+ " AND Rdo_Change_Gmt >= sysdate - 3"
+ " UNION ALL"
+ " SELECT 'ZCS_COLLISION_FLAG' AS COLLISION_FLAG"
+ " FROM CIE.SYNC_ARCHIVE"
+ " WHERE Rdo_Typ = '" + rdoType + "'"
+ " AND Rdo_Key = '" + rdoKey + "'"
+ " AND Rdo_Change_Gmt >= sysdate - 3 " + ")"
+ " WHERE ROWNUM = 1";
|
|