=== modified file 'src/com/goldencode/p2j/persist/dialect/Dialect.java'
--- old/src/com/goldencode/p2j/persist/dialect/Dialect.java	2023-01-10 16:58:00 +0000
+++ new/src/com/goldencode/p2j/persist/dialect/Dialect.java	2023-01-20 15:56:52 +0000
@@ -91,6 +91,7 @@
 **     RAA 20230109          Added method getSequenceSetValString().
 **     SVL 20230110          P2JIndex.components() provides direct access to the components array in order to
 **                           improve performance.
+**     AL2 20230117          Consider selection using wildcard with allowSelectWildcard.
 */
 
 /*
@@ -1529,4 +1530,15 @@
    {
       return index.getName();
    }
+
+   /**
+    * Check if this dialect allows the selection of fields using * wildcard. Also, quantification should
+    * also be supported if this is allowed (alias.*).
+    * 
+    * @return   {@code true} if we can use * as selection wildcard.
+    */
+   public boolean allowSelectWildcard()
+   {
+      return false;
+   }
 }

=== modified file 'src/com/goldencode/p2j/persist/dialect/P2JH2Dialect.java'
--- old/src/com/goldencode/p2j/persist/dialect/P2JH2Dialect.java	2023-01-10 09:20:39 +0000
+++ new/src/com/goldencode/p2j/persist/dialect/P2JH2Dialect.java	2023-01-20 15:56:52 +0000
@@ -105,6 +105,7 @@
 **     OM  20221026          Excluded table name from index name by default. It will be added as needed by
 **                           dialects.
 **     RAA 20230109          Overrided methods getSequenceSetValString() and getSequenceCurrValString().
+**     AL2 20230117          Allow allowSelectWildcard.
 */
 
 /*
@@ -1820,4 +1821,15 @@
    {
       return "idx__" + index.getTable() + "_" + index.getName();
    }
+
+   /**
+    * Check if this dialect allows the selection of fields using * wildcard. Also, quantification should
+    * also be supported if this is allowed (alias.*).
+    * 
+    * @return   {@code true} if we can use * as selection wildcard.
+    */
+   public boolean allowSelectWildcard()
+   {
+      return true;
+   }
 }

=== modified file 'src/com/goldencode/p2j/persist/orm/DmoMeta.java'
--- old/src/com/goldencode/p2j/persist/orm/DmoMeta.java	2023-01-20 12:07:41 +0000
+++ new/src/com/goldencode/p2j/persist/orm/DmoMeta.java	2023-01-20 15:56:52 +0000
@@ -45,6 +45,7 @@
 **     SVL 20230113 Improved performance by replacing some "for-each" loops with indexed "for" loops.
 **     HC  20230118 Eliminated some of the uses of String.toUpperCase and/or String.toLowerCase
 **                  for performance.
+**     AL2 20230120 Compute if the underlying DMO requires extra computed columns.
 **     CA  20221114 Added API to get the denormalized properties for a DMO extent property name.
 */
 
@@ -277,6 +278,9 @@
    /** Map of property names to extents for DMO array properties */
    private Map<String, Integer> extentMap = null;
    
+   /** Check if this DMO is going to have computed columns in the underlying database representation */
+   private Boolean hasComputedColumns = null;
+   
    /** The map used in type-widening operations. */
    private static final Map<Class<? extends BaseDataType>, Class<? extends BaseDataType>> toWider = 
          new IdentityHashMap<>();
@@ -1574,6 +1578,61 @@
    }
    
    /**
+    * Check if this DMO has computed columns in the underlying database representation. This is 
+    * used mostly for temporary tables and may not be completely compatible with persistent tables.
+    * 
+    * @return   {@code true} if we also have other columns that the legacy ones in the database.
+    */
+   public boolean hasComputedColumns()
+   {
+      if (hasComputedColumns == null)
+      {
+         hasComputedColumns = false;
+         
+         Set<Map.Entry<String, Property>> fieldEntries = this.propsByName.entrySet();
+ 
+         Set<Property> indexedProperties = new HashSet<>();
+         Iterator<P2JIndex> databaseIndexes = this.getDatabaseIndexes();
+       
+         while (databaseIndexes.hasNext())
+         {
+            P2JIndex index = databaseIndexes.next();
+            ArrayList<P2JIndexComponent> components = index.components();
+            for (int i = 0; i < components.size(); i++)
+            {
+               P2JIndexComponent comp = components.get(i);            
+               Property property = this.getFieldInfo(comp.getPropertyName());
+               indexedProperties.add(property);
+            }
+         }
+
+         for (Map.Entry<String, Property> field : fieldEntries)
+         {
+            Property property = field.getValue();
+            
+            if (indexedProperties.contains(property) && property._isCharacter)
+            {
+               hasComputedColumns = true;
+               break;
+            }
+
+            if (property.extent > 0)
+            {
+               hasComputedColumns = true;
+               break;
+            }
+            
+            if (property._isDatetimeTz)
+            {
+               hasComputedColumns = true;
+               break;
+            }
+         }
+      }
+      return hasComputedColumns;
+   }
+   
+   /**
     * Get the map of DMO property names to {@code P2JField} objects describing the corresponding fields,
     * creating it first, if necessary.
     * 

=== modified file 'src/com/goldencode/p2j/persist/orm/FqlToSqlConverter.java'
--- old/src/com/goldencode/p2j/persist/orm/FqlToSqlConverter.java	2023-01-20 12:07:41 +0000
+++ new/src/com/goldencode/p2j/persist/orm/FqlToSqlConverter.java	2023-01-20 15:56:52 +0000
@@ -45,6 +45,7 @@
 **     SVL 20230108 Improved performance by replacing some "for-each" loops with indexed "for" loops.
 **         20221031 Collected fields of "select" query.
 **         20221101 Fixed possible NPE.
+**     AL2 20230120 Introduced wildcard selection for some temp-tables.
 */
 
 /*
@@ -123,6 +124,7 @@
 import com.goldencode.p2j.schema.*;
 import com.goldencode.p2j.util.*;
 import com.goldencode.p2j.util.LogicalExpressionConverter.*;
+
 import org.apache.commons.lang3.tuple.*;
 import antlr.*;
 
@@ -291,7 +293,7 @@
       this.schema = db.isMeta() ? MetadataManager.META_SCHEMA : DatabaseManager.getSchema(db);
       this.queryParams = queryParams;
       this.useSqlTableAlias = useSqlTableAlias;
-      this.generateUniqueSqlColumnNames = true;
+      this.generateUniqueSqlColumnNames = false;
       this.useWordTables = !SchemaDictionary.TEMP_TABLE_DB.equals(schema) && 
                            !db.isDirty() && !db.isMeta() && dialect.useWordTables();
    }
@@ -1447,6 +1449,19 @@
       while(!tbls.add(cte));
       return cte;
    }
+   
+   /**
+    * Check if we can simply use an alias.* syntax instead of listing all SQL fields. 
+    *
+    * @param    dmoMeta
+    *           The meta of the table to be considered for wildcard field selection.
+    *
+    * @return   {@code true} if we can emit an wildcard syntax for field selection.
+    */
+   private boolean canUseWildcard(DmoMeta dmoMeta)
+   {
+      return cte4order == null && !dmoMeta.hasComputedColumns();
+   }
 
    /**
     * Expands the alias into all its properties in a SELECT clause.
@@ -1462,6 +1477,24 @@
    {
       int fieldCounter = 0;
       String sqlTableAliasName = getSqlTableAliasName(alias);
+      if (dialect.allowSelectWildcard() && 
+          canUseWildcard(dmoMeta) &&
+          !NO_ALIAS.equals(sqlTableAliasName))
+      {
+         if (!first)
+         {
+            sb.append(", ");
+         }
+         sb.append(sqlTableAliasName).append(".*");
+         fieldCounter = dmoMeta.propsByName.size();
+
+         if (rowStructure != null)
+         {
+            rowStructure.add(new RowStructure(dmoMeta.dmoImplInterface, fieldCounter));
+         }
+         
+         return;
+      }
       Set<Map.Entry<String, Property>> fieldEntries = dmoMeta.propsByName.entrySet();
       for (Map.Entry<String, Property> field : fieldEntries)
       {
@@ -1514,7 +1547,7 @@
                if (generateUniqueSqlColumnNames)
                {
                   sb.append(" as ");
-                  appendColAlias.accept("column");
+                  appendColAlias.accept("c");
                }
                ++fieldCounter;
             }
@@ -1528,7 +1561,7 @@
             if (generateUniqueSqlColumnNames)
             {
                sb.append(" as ");
-               appendColAlias.accept("column");
+               appendColAlias.accept("c");
             }
             ++fieldCounter;
          }
@@ -3169,24 +3202,12 @@
       {
          return "id" + (columnUid++) + "_";
       }
-      else if (property.propId < 0)
-      {
-         return "column" + (columnUid++) + "_" + (aliases.size() - 1) + "_";
-      }
       else
       {
-         String fqlName = property.column;
-         int k = 0;
-         while (k < fqlName.length() && Character.isLetter(fqlName.charAt(k)))
-         {
-            k++;
-         }
-         String sqlName = fqlName.substring(0, k);
-         if (sqlName.isEmpty())
-         {
-            sqlName = "column";
-         }
-         return sqlName +  (columnUid++) + "_" + (aliases.size() - 1) + "_";
+         // in most of the cases the aliases deque is empty, so avoid forcing extra characters in the alias:
+         // convey that ord == 0 is the same as lacking ord
+         int ord = aliases.size() - 1;
+         return "c" + (columnUid++) + (ord == 0 ? "" : "_" + ord) + "_";
       }
    }
    

