db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Re: Putting schema into the select clause
Date Mon, 30 Aug 2004 09:14:16 GMT
"Lach, Thierry" <Thierry.Lach@bbdodetroit.com> writes:


>1.  Make sure the schema is optional.

Yes.

>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).

Definitely. I will be using different schemata with PostgreSQL to select
project versions in the future so expect to see this. :-)

>3.  Suggest you use aliases.

>So your sql becomes

>SELECT ALIAS.COLUMN FROM SCHEMA.TABLENAME ALIAS WHERE  ALIAS.COLUMNB > 5

	Regards
		Henning



>Or

>SELECT ALIAS.COLUMN FROM SCHEMA.TABLENAME AS ALIAS WHERE  ALIAS.COLUMNB
>> 5

>Depending on the required syntax.

>-----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>

>Since I really really like the whole process and idea of Torque I want
>to extend this.

>I've already started to modify the generator and have added a
>schema="blah" attribute to the table element since it makes sence to me
>that tables should have schema information embedded rather then at the
>database level.  Since that way you can have a database of multiple
>schemas all grouped together and do cross schema joins.

>Ok, the big problem seems to me that depending on where in the schema
>clause you need to use slightly different names for the table.

>Sometimes you want to use
>SCHEMA.TABLENAME
>and sometimes just TABLENAME.

>Or do all DBs let you do stuff like
>SELECT SCHEMA.TABLENAME.COLUMN FROM SCHEMA.TABLENAME WHERE
>SCHEMA.TABLENAME.COLUMNB > 5 ??

>If this is the case then all that really needs to be done is change the
>TABLE_NAME variable to be SCHEMA.TABLENAME rather then what it is now
>which is just TABLENAME

>At which point adding a schema seems almost esoteric, but I think that
>it should be added for the sake of completeness and correctness.  As
>Schema does play a role in the resulting SQL statments that should be
>generated.

>Cause the api seems to use Strings all over the place as keys,
>especially when doing lookups of table related data, it simple uses the
>TABLE_NAME as a key to get column information. So adding schema
>information would mean changing all the critera object as well. I
>believe.

>Any ideas, thoughts, comments?

>To developers of torque, whats the easiest way to start submitting
>patches?

>On Fri, 27 Aug 2004 10:03:42 -0500, mark.a.gold@accenture.com


><mark.a.gold@accenture.com> wrote:
>> I am in complete agreement and I have no explanation as to why it is
>> omitted. Our workaround in both Oracle and DB2 (mainframe) is to use
>> synonyms. Our security model requires the application log in as a
>> third party so the use of private synonyms was necessary.
>>
>> hth, mark
>>
>>
>>
>> -----Original Message-----
>> From: Steve Toth [mailto:steveftoth@gmail.com]
>> Sent: Friday, August 27, 2004 10:58 AM
>> To: Gold, Mark A.
>> Subject: Re: Putting schema into the select clause
>>
>> Well that is too bad that it doesn't support it yet because it seems
>> like this should be a standard feature as without schema information
>> it seems like this information it will be useless to me as our (albeit
>> insane) database design requires the useage of fully qualified schemas

>> to work properly.
>>
>> How would I go about implementing this in Torque if I wanted to add
>> it? Do it and then make a patch or something.  This seems like a very
>> fundamental change, effecting many low level Torque classes.  Anyone
>> else think that this feature needs to be added?
>>
>> Thanks,
>> Steve Toth
>>
>> On Fri, 27 Aug 2004 08:01:10 -0500, mark.a.gold@accenture.com
>> <mark.a.gold@accenture.com> wrote:
>> > Steve, This is an ongoing issue with Torque and one I have not seen
>> > a solution for. Although some solutions have been offered on this
>> > list there currently seems to be no practical way to fully qualify
>> > object names.
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Steve Toth [mailto:steveftoth@gmail.com]
>> > Sent: Thursday, August 26, 2004 7:39 PM
>> > To: torque-user@db.apache.org
>> > Subject: Putting schema into the select clause
>> >
>> > I'm trying to use Torque with Oracle and I'm not sure how to get
>> > torque to put the schema before all table names during select
>> > operations...
>> >
>> > Right now the SQL is coming out like this..
>> >
>> > SELECT TABLE.COL1, TABLE.COL2, TABLE.COL3 FROM TABLE
>> >
>> > I want it to look like this
>> > SELECT TABLE.COL1, TABLE.COL2, TABLE.COL3 FROM SCHEMA.TABLE
>> >
>> > or
>> > SELECT TABLE.COL1, TABLE.COL2, TABLE.COL3 ,TABLE2.COL1 FROM
>> > SCHEMA.TABLE, SCHEMA2.TABLE2
>> >
>> > What do I need to do in my schema.xml file, or generation ?
>> >
>> > Thanks!
>> >
>> > --------------------------------------------------------------------
>> > -
>> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>> > For additional commands, e-mail: torque-user-help@db.apache.org
>> >
>> > This message is for the designated recipient only and may contain
>> > privileged, proprietary, or otherwise private information.  If you
>> > have received it in error, please notify the sender immediately and
>> > delete the original.  Any other use of the email by you is
>> > prohibited.
>> >
>>
>> This message is for the designated recipient only and may contain
>> privileged, proprietary, or otherwise private information.  If you
>> have received it in error, please notify the sender immediately and
>> delete the original.  Any other use of the email by you is prohibited.
>>

>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org


>This message and any attachments contain information, which may be confidential or privileged.
 If you are not the intended recipient, please refrain from any disclosure, copying, distribution
or use of this information.  Please be aware that such actions are prohibited.  If you have
received this transmission in error, kindly notify us by calling 1-800-262-4723 or e-mail
to helpdesk@bbdo.com. We appreciate your cooperation.

>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
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