On Nov 23, 10:38 pm, "Wesley Moore" <[EMAIL PROTECTED]> wrote: > The code in question from dataset/sql.rb is shown below. > to_table_reference calls as_sql if an alias is supplied. The alias is > supplied by source_list when selecting from a Dataset. This generates > something like: ...FROM (sql) AS "T1". From what I can tell Oracle > doesn't support aliasing sub-queries with AS, you just provide the > alias E.g. ...FROM (sql) "T1"
I don't use Oracle, so I can't test this, but here's a patch that may work. It will omit the use of AS for every case where something is aliased, so if there is any case where Oracle requires the use of AS, it will break. If that is the case, we'll have to do some refactoring. Anyway, please test this patch with the latest master branch and let me know if it works. Thanks, Jeremy diff --git a/lib/sequel_core/adapters/shared/oracle.rb b/lib/ sequel_core/adapters/shared/oracle.rb index f20b24b..425d48d 100644 --- a/lib/sequel_core/adapters/shared/oracle.rb +++ b/lib/sequel_core/adapters/shared/oracle.rb @@ -21,6 +21,11 @@ module Sequel private + # SQL fragment for specifying an alias. expression should already be literalized. + def as_sql(expression, aliaz) + "#{expression} #{quote_identifier(aliaz)}" + end + def select_clause_order SELECT_CLAUSE_ORDER end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---