Hi,

I believe the simplest way to allow fully qualified table names is to use
schema.tablename as tablename in the database schema xml. This would mean
that one would use schemaname.tablename instead of tablename all the time,
but I do not know a sql statement where this would not work.
The problem with this approach is that internally, columns are often
referenced by their "fully qualified name", i.e. "tablename.columnname",
and afterwards, the separate tablename and columnname are extracted by
determining the position of the dot via
fullyQualifiedColumnName.indexof("."). For the above approach to work,
these places would have to be replaced by
fullyQualifiedColumnName.lastIndexof(".").
Some months ago, somebody has said that he had made lots of changes to make
fully qualified tablenames work, but I did not see any patches. Perhaps you
should contact him ?

More comments inserted below

"Lach, Thierry" <[EMAIL PROTECTED]> schrieb am 27.08.2004
21:20:57:

>
> 1.  Make sure the schema is optional.
>

This is certainly a good idea

> 2.  Make sure that the schema can be overridden at runtime.  We've got
> several schema that are identical and it would be nice to be able to do
> runtime selection of the schema (especially for reporting purposes)
> while using a single connection (alternative would be to have multiple
> identifiers in torque.properties).
>

I am not sure how much work this is. At the moment, tablenames cannot be
changed at runtime, so my guess would be that the mechanisms to do this
would have to be built in from the beginnings. It would seeem to me that
the effort and code complexity to achieve this do not justify the benefits,
but of course this is my personal opinion.

> 3.  Suggest you use aliases.
>
> So your sql becomes
>
> SELECT ALIAS.COLUMN FROM SCHEMA.TABLENAME ALIAS WHERE  ALIAS.COLUMNB > 5
>
>
> Or
>
> SELECT ALIAS.COLUMN FROM SCHEMA.TABLENAME AS ALIAS WHERE  ALIAS.COLUMNB
> > 5
>
>
> Depending on the required syntax.

I do not see the reason behind this suggestion. This is certainly a lot of
work, but what are the benefits ?

> -----Original Message-----
> From: Steve Toth [mailto:[EMAIL PROTECTED]
>
> Sent: Friday, August 27, 2004 2:57 PM
> To: [EMAIL PROTECTED]
> Subject: Fwd: Putting schema into the select clause
>
>
> ---------- Forwarded message ----------
> From: Steve Toth <[EMAIL PROTECTED]>
> Date: Fri, 27 Aug 2004 11:55:56 -0700
> Subject: Re: Putting schema into the select clause
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>
> ...
>
> To developers of torque, whats the easiest way to start submitting
> patches?
>

I would strongly recoommend to use the sources from CVS HEAD, guess this
makes it loads easier for the committers to apply your patches.
Apply your changes, also write test cases to see if things work as
expected, run all the other test cases as well to see if they still work,
and then upload your changes via scarab (the bugtracker),

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to