After playing some more with on-the-fly fields, I thought I should report back. There have been 2 suggested methods.
1. I have successfully created fields as functions in the rose class as suggested by JonathanV. These work nicely. Also, I have managed to enable these to be generated automatically in the module concerned using Loader with the module_postamble parameter pointing to a function copies them in from a special "function" file, if that file exists for a class. 2. The Function on-the-fly fields above won't work with SQL "order by" (Rose sort_by). For this JonathanS suggested a workaround: create a column class that replaces the field name with an aliased SQL function and then use this alias in the "order by" statement. This works well for a single table but there are 2 issues. Firstly, Loader doesn't like using the spurious column class. This is not a big deal - can just manually fix it after each generation. Secondly, if you use a join with 2 tables, this seems to produce an SQL error (will detail in a separate thread). I need to do this so if there's no solution, I will revert to method 1 and use PERL to do the sort instead of SQL. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object