db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject RE: Putting schema into the select clause
Date Sat, 28 Aug 2004 09:32:15 GMT





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" <Thierry.Lach@bbdodetroit.com> 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:steveftoth@gmail.com]
>
> Sent: Friday, August 27, 2004 2:57 PM
> To: torque-user@db.apache.org
> Subject: Fwd: Putting schema into the select clause
>
>
> ---------- Forwarded message ----------
> From: Steve Toth <steveftoth@gmail.com>
> Date: Fri, 27 Aug 2004 11:55:56 -0700
> Subject: Re: Putting schema into the select clause
> To: "mark.a.gold@accenture.com" <mark.a.gold@accenture.com>
>
> ...
>
> 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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message