Index: ComboTableData.java
===================================================================
--- ComboTableData.java	(revision 801)
+++ ComboTableData.java	(working copy)
@@ -371,6 +371,8 @@
    *          String for group fields.
    */
   public void addWhereField(String _field, String _type) {
+    if("FILTER".equals(_type))
+      _field = _field.replaceAll( "_ID=\\?", "_ID=TO_NUMBER(?)" );
     QueryFieldStructure p = new QueryFieldStructure(_field, "", "", _type);
     if (this.where == null)
       this.where = new Vector<QueryFieldStructure>();
@@ -661,7 +663,7 @@
         + ".ad_ref_list_id = td_trl" + myIndex + ".ad_ref_list_id AND td_trl" + myIndex
         + ".ad_language = ?", "td_trl" + myIndex);
     addFromParameter("#AD_LANGUAGE", "LANGUAGE");
-    addWhereField("td" + myIndex + ".ad_reference_id = (?)", "KEY");
+    addWhereField("td" + myIndex + ".ad_reference_id = TO_NUMBER(?)", "KEY");
     if (referenceValue == null || referenceValue.equals("")) {
       addWhereParameter("AD_REFERENCE_ID", "KEY", "KEY");
       setParameter("AD_REFERENCE_ID", getObjectReference());
@@ -731,7 +733,7 @@
     if (tableName == null || tableName.equals("")) {
       parseValidation();
       addWhereField("(td" + myIndex + ".isActive = 'Y' OR td" + myIndex + "." + trd[0].keyname
-          + " = (?) )", "ISACTIVE");
+          + " = TO_NUMBER(?) )", "ISACTIVE");
       addWhereParameter("@ACTUAL_VALUE@", "ACTUAL_VALUE", "ISACTIVE");
     }
     String orderByAux = (trd[0].orderbyclause.equals("") ? "2" : trd[0].orderbyclause);
@@ -774,7 +776,7 @@
     addFromField(tables, "td" + myIndex);
     if (tableName == null || tableName.equals("")) {
       parseValidation();
-      addWhereField("(td" + myIndex + ".isActive = 'Y' OR td" + myIndex + "." + name + " = (?) )",
+      addWhereField("(td" + myIndex + ".isActive = 'Y' OR td" + myIndex + "." + name + " = TO_NUMBER(?) )",
           "ISACTIVE");
       addWhereParameter("@ACTUAL_VALUE@", "ACTUAL_VALUE", "ISACTIVE");
     }
@@ -1278,7 +1280,11 @@
       iParameter = setSQLParameters(st, iParameter, null);
       boolean idFound = false;
       String actual = getParameter("@ACTUAL_VALUE@");
+      long startTime = System.currentTimeMillis();
+      System.out.println("**** " + strSql);
       result = st.executeQuery();
+      long currentTime = System.currentTimeMillis();
+      System.out.println("Time elapsed: " + (currentTime - startTime) + "ms");
       while (result.next()) {
         SQLReturnObject sqlReturnObject = new SQLReturnObject();
         sqlReturnObject.setData("ID", UtilSql.getValue(result, "ID"));
