Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I know that neither SQL Server nor Oracle will support that syntax. Once you alias a table name in a query, you must use the alias within the scope of that query.

    It may be part of the SQL standard. I'm not sure, and the document is a bear to grep thru.

    I agree the error message could be clearer.

    • by avik (3911) on 2007.04.06 10:38 (#54240) Journal
      I stumbled upon it too just the other day.
      But it makes sense, doesn't it?

      Imagine this
      select F.*, B.*
      from SERVER1.DB1.owner1.FOOFOOFOOFOOFOO_2005 F
      join SERVER2.DB2.owner2.BARBARBARBARBAR_2005 B
      on F.first_field = B.first_field
      and F.second_field = B.second_field
      and F.third_field = B.third_field
      and F.fourth_field = B.fourth_field
      and F.you_get_the_idea = 1
      where f.something = 'something'
          and b.another_thing != 'something'
      order by 1,2,3

      If address for table changes for some reason (and it happens) all you need to worry about is "FROM" clause. However if we had a choice whether to use an alias or a real name of table that could be a disaster to debug, IMHO.