You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Jim <sm...@yahoo.com> on 2008/03/06 19:22:32 UTC

Duplicate references in the foreign-key

Hi,
I started running into a duplicate reference in the
foreign-key issue several months ago in the ant
generated schema.xml file. 
We are still using the 3.2 rc2 version of Torque and
the tables are DB2.

Here is an example of the dup reference..
<foreign-key foreignTable="TABLE2">
   <reference foreign="OFFRG_N" local="OFFRG_N"/>
   <reference foreign="OFFRG_N" local="OFFRG_N"/>
</foreign-key>

Here is a portion the table that has the forigh-key..
<table name="TABLE2">
        <column name="OFFRG_N" primaryKey="true"
required="true" size="12" type="CHAR"/>

The dba's swear there have been no changes to the DB2
tables. 

Thanks for any suggestions!
Jim


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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


Re: Duplicate references in the foreign-key

Posted by Jim <sm...@yahoo.com>.
Hi Philip,
That's the thing.. There is only one foreigh key but
ant creates 2 identical ones in the schema.xml file.
And not just for those two tables but in many.
I suspect something on the DB2 side changed since the
way we generate the schema file has not changed. 

At the same time the default values for many columns
are now showing static values that do not exist.
Odd... 
Jim

--- Philip Reimann <re...@synyx.de> wrote:

> There's no chance to use version 3.2-rc2 for this
> demand. The
> torque-generator wont create correct files.
> You have to use version 3.2-rc3 (or higher) to set
> two foreign keys from
> one table to one other table.
> 
> Greetings Philip
> 
> Jim schrieb:
> > Hi,
> > I started running into a duplicate reference in
> the
> > foreign-key issue several months ago in the ant
> > generated schema.xml file. 
> > We are still using the 3.2 rc2 version of Torque
> and
> > the tables are DB2.
> > 
> > Here is an example of the dup reference..
> > <foreign-key foreignTable="TABLE2">
> >    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> >    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> > </foreign-key>
> > 
> > Here is a portion the table that has the
> forigh-key..
> > <table name="TABLE2">
> >         <column name="OFFRG_N" primaryKey="true"
> > required="true" size="12" type="CHAR"/>
> > 
> > The dba's swear there have been no changes to the
> DB2
> > tables. 
> > 
> > Thanks for any suggestions!
> > Jim
> > 
> > 
> >      
>
____________________________________________________________________________________
> > Be a better friend, newshound, and 
> > know-it-all with Yahoo! Mobile.  Try it now. 
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> torque-user-help@db.apache.org
> > 
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
> 
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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


Re: Duplicate references in the foreign-key

Posted by Philip Reimann <re...@synyx.de>.
There's no chance to use version 3.2-rc2 for this demand. The
torque-generator wont create correct files.
You have to use version 3.2-rc3 (or higher) to set two foreign keys from
one table to one other table.

Greetings Philip

Jim schrieb:
> Hi,
> I started running into a duplicate reference in the
> foreign-key issue several months ago in the ant
> generated schema.xml file. 
> We are still using the 3.2 rc2 version of Torque and
> the tables are DB2.
> 
> Here is an example of the dup reference..
> <foreign-key foreignTable="TABLE2">
>    <reference foreign="OFFRG_N" local="OFFRG_N"/>
>    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> </foreign-key>
> 
> Here is a portion the table that has the forigh-key..
> <table name="TABLE2">
>         <column name="OFFRG_N" primaryKey="true"
> required="true" size="12" type="CHAR"/>
> 
> The dba's swear there have been no changes to the DB2
> tables. 
> 
> Thanks for any suggestions!
> Jim
> 
> 
>       ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 

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


Re: Duplicate references in the foreign-key

Posted by Jim <sm...@yahoo.com>.
Interesting.. I didn't know that was possible. I'll
contact the dba and to verify.
Thanks!

 
--- Martin Tilsted <ti...@daimi.au.dk> wrote:

> I had a similary problem with mysql 5.0.27 My
> problem was that i did
> alter table MyTable add foreign key ...
> twice. This caused mysql to add the key twice,
> instead of detecting that 
> it's already there and do nothing.
> And this caused torque to generate the same
> <foreign-key> twice which 
> caused problems.
> 
> My solution was simply to drop the foreign key.
> (This caused both keys 
> to be dropped) and then just added
> the foreign key once.
> 
> Jim wrote:
> > Thomas,
> >
> > The standard process except we are still using Ant
> to
> > generate the schema file using the ant command ant
> -f
> > build-torque.xml jdbc.
> > That's it. The file generated has the dup
> references.
> > The source is mainframe DB2.
> > We have not changed anything rcently except moving
> to
> > the 3.2 rc2 version of Torque when it became
> > available. But that is not the issue.
> >
> > I suspect something is different on the DB2 side
> but
> > the dba's say no. And that's probably where the
> issue
> > is and I'm hoping someone ran into the same issue
> and
> > can give me a clue as to what I can look for to
> find
> > the issue.
> >
> > Jim 
> >
> >
> > --- Thomas Fischer <fi...@seitenbau.net> wrote:
> >
> >   
> >> Could you please give a short description of what
> >> you do ? I don't have a
> >> clue.
> >>
> >>     Thomas
> >>
> >> Jim <sm...@yahoo.com> schrieb am 06.03.2008
> >> 19:22:32:
> >>
> >>     
> >>> Hi,
> >>> I started running into a duplicate reference in
> >>>       
> >> the
> >>     
> >>> foreign-key issue several months ago in the ant
> >>> generated schema.xml file.
> >>> We are still using the 3.2 rc2 version of Torque
> >>>       
> >> and
> >>     
> >>> the tables are DB2.
> >>>
> >>> Here is an example of the dup reference..
> >>> <foreign-key foreignTable="TABLE2">
> >>>    <reference foreign="OFFRG_N"
> local="OFFRG_N"/>
> >>>    <reference foreign="OFFRG_N"
> local="OFFRG_N"/>
> >>> </foreign-key>
> >>>
> >>> Here is a portion the table that has the
> >>>       
> >> forigh-key..
> >>     
> >>> <table name="TABLE2">
> >>>         <column name="OFFRG_N" primaryKey="true"
> >>> required="true" size="12" type="CHAR"/>
> >>>
> >>> The dba's swear there have been no changes to
> the
> >>>       
> >> DB2
> >>     
> >>> tables.
> >>>
> >>> Thanks for any suggestions!
> >>> Jim
> >>>       
> >>
> >>     
> >
>
---------------------------------------------------------------------
> >   
> >> To unsubscribe, e-mail:
> >> torque-user-unsubscribe@db.apache.org
> >> For additional commands, e-mail:
> >> torque-user-help@db.apache.org
> >>
> >>
> >>     
> >
> >
> >
> >      
>
____________________________________________________________________________________
> > Be a better friend, newshound, and 
> > know-it-all with Yahoo! Mobile.  Try it now. 
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> 
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> torque-user-help@db.apache.org
> >   
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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


Re: Duplicate references in the foreign-key

Posted by Martin Tilsted <ti...@daimi.au.dk>.
I had a similary problem with mysql 5.0.27 My problem was that i did
alter table MyTable add foreign key ...
twice. This caused mysql to add the key twice, instead of detecting that 
it's already there and do nothing.
And this caused torque to generate the same <foreign-key> twice which 
caused problems.

My solution was simply to drop the foreign key. (This caused both keys 
to be dropped) and then just added
the foreign key once.

Jim wrote:
> Thomas,
>
> The standard process except we are still using Ant to
> generate the schema file using the ant command ant -f
> build-torque.xml jdbc.
> That's it. The file generated has the dup references.
> The source is mainframe DB2.
> We have not changed anything rcently except moving to
> the 3.2 rc2 version of Torque when it became
> available. But that is not the issue.
>
> I suspect something is different on the DB2 side but
> the dba's say no. And that's probably where the issue
> is and I'm hoping someone ran into the same issue and
> can give me a clue as to what I can look for to find
> the issue.
>
> Jim 
>
>
> --- Thomas Fischer <fi...@seitenbau.net> wrote:
>
>   
>> Could you please give a short description of what
>> you do ? I don't have a
>> clue.
>>
>>     Thomas
>>
>> Jim <sm...@yahoo.com> schrieb am 06.03.2008
>> 19:22:32:
>>
>>     
>>> Hi,
>>> I started running into a duplicate reference in
>>>       
>> the
>>     
>>> foreign-key issue several months ago in the ant
>>> generated schema.xml file.
>>> We are still using the 3.2 rc2 version of Torque
>>>       
>> and
>>     
>>> the tables are DB2.
>>>
>>> Here is an example of the dup reference..
>>> <foreign-key foreignTable="TABLE2">
>>>    <reference foreign="OFFRG_N" local="OFFRG_N"/>
>>>    <reference foreign="OFFRG_N" local="OFFRG_N"/>
>>> </foreign-key>
>>>
>>> Here is a portion the table that has the
>>>       
>> forigh-key..
>>     
>>> <table name="TABLE2">
>>>         <column name="OFFRG_N" primaryKey="true"
>>> required="true" size="12" type="CHAR"/>
>>>
>>> The dba's swear there have been no changes to the
>>>       
>> DB2
>>     
>>> tables.
>>>
>>> Thanks for any suggestions!
>>> Jim
>>>       
>>
>>     
> ---------------------------------------------------------------------
>   
>> To unsubscribe, e-mail:
>> torque-user-unsubscribe@db.apache.org
>> For additional commands, e-mail:
>> torque-user-help@db.apache.org
>>
>>
>>     
>
>
>
>       ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>   


RE: Duplicate references in the foreign-key

Posted by Jim <sm...@yahoo.com>.
Thanks Thomas,

It's odd but the following code is also being
generated with a default value that does not exist.
(CURRENT DATE). I'm guessing that has something to do
with the way the column is setup in DB2. 
Thanks!
Jim
        <column default="CURRENT DATE"
name="POL_EFF_D" required="true" type="DATE"/>
        <column default="CURRENT DATE"
name="POL_EXP_D" required="true" type="DATE"/>







--- Thomas Fischer <fi...@seitenbau.net> wrote:

> If Martin's advice does not work out, it could also
> be a different jdbc
> driver. Torque uses only information that the jdbc
> driver gives; it does
> not do any post-processing.
> 
>     Thomas
> 
> Jim <sm...@yahoo.com> schrieb am 13.03.2008
> 11:30:34:
> 
> > Thomas,
> >
> > The standard process except we are still using Ant
> to
> > generate the schema file using the ant command ant
> -f
> > build-torque.xml jdbc.
> > That's it. The file generated has the dup
> references.
> > The source is mainframe DB2.
> > We have not changed anything rcently except moving
> to
> > the 3.2 rc2 version of Torque when it became
> > available. But that is not the issue.
> >
> > I suspect something is different on the DB2 side
> but
> > the dba's say no. And that's probably where the
> issue
> > is and I'm hoping someone ran into the same issue
> and
> > can give me a clue as to what I can look for to
> find
> > the issue.
> >
> > Jim
> >
> >
> > --- Thomas Fischer <fi...@seitenbau.net> wrote:
> >
> > > Could you please give a short description of
> what
> > > you do ? I don't have a
> > > clue.
> > >
> > >     Thomas
> > >
> > > Jim <sm...@yahoo.com> schrieb am
> 06.03.2008
> > > 19:22:32:
> > >
> > > > Hi,
> > > > I started running into a duplicate reference
> in
> > > the
> > > > foreign-key issue several months ago in the
> ant
> > > > generated schema.xml file.
> > > > We are still using the 3.2 rc2 version of
> Torque
> > > and
> > > > the tables are DB2.
> > > >
> > > > Here is an example of the dup reference..
> > > > <foreign-key foreignTable="TABLE2">
> > > >    <reference foreign="OFFRG_N"
> local="OFFRG_N"/>
> > > >    <reference foreign="OFFRG_N"
> local="OFFRG_N"/>
> > > > </foreign-key>
> > > >
> > > > Here is a portion the table that has the
> > > forigh-key..
> > > > <table name="TABLE2">
> > > >         <column name="OFFRG_N"
> primaryKey="true"
> > > > required="true" size="12" type="CHAR"/>
> > > >
> > > > The dba's swear there have been no changes to
> the
> > > DB2
> > > > tables.
> > > >
> > > > Thanks for any suggestions!
> > > > Jim
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > torque-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail:
> > > torque-user-help@db.apache.org
> > >
> > >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> 
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile.  Try it now. 
> http://mobile.yahoo.com/;
> > _ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> torque-user-help@db.apache.org
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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


RE: Duplicate references in the foreign-key

Posted by Thomas Fischer <fi...@seitenbau.net>.
If Martin's advice does not work out, it could also be a different jdbc
driver. Torque uses only information that the jdbc driver gives; it does
not do any post-processing.

    Thomas

Jim <sm...@yahoo.com> schrieb am 13.03.2008 11:30:34:

> Thomas,
>
> The standard process except we are still using Ant to
> generate the schema file using the ant command ant -f
> build-torque.xml jdbc.
> That's it. The file generated has the dup references.
> The source is mainframe DB2.
> We have not changed anything rcently except moving to
> the 3.2 rc2 version of Torque when it became
> available. But that is not the issue.
>
> I suspect something is different on the DB2 side but
> the dba's say no. And that's probably where the issue
> is and I'm hoping someone ran into the same issue and
> can give me a clue as to what I can look for to find
> the issue.
>
> Jim
>
>
> --- Thomas Fischer <fi...@seitenbau.net> wrote:
>
> > Could you please give a short description of what
> > you do ? I don't have a
> > clue.
> >
> >     Thomas
> >
> > Jim <sm...@yahoo.com> schrieb am 06.03.2008
> > 19:22:32:
> >
> > > Hi,
> > > I started running into a duplicate reference in
> > the
> > > foreign-key issue several months ago in the ant
> > > generated schema.xml file.
> > > We are still using the 3.2 rc2 version of Torque
> > and
> > > the tables are DB2.
> > >
> > > Here is an example of the dup reference..
> > > <foreign-key foreignTable="TABLE2">
> > >    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> > >    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> > > </foreign-key>
> > >
> > > Here is a portion the table that has the
> > forigh-key..
> > > <table name="TABLE2">
> > >         <column name="OFFRG_N" primaryKey="true"
> > > required="true" size="12" type="CHAR"/>
> > >
> > > The dba's swear there have been no changes to the
> > DB2
> > > tables.
> > >
> > > Thanks for any suggestions!
> > > Jim
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> > torque-user-help@db.apache.org
> >
> >
>
>
>
>
>
____________________________________________________________________________________

> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;
> _ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


RE: Duplicate references in the foreign-key

Posted by Jim <sm...@yahoo.com>.
Thomas,

The standard process except we are still using Ant to
generate the schema file using the ant command ant -f
build-torque.xml jdbc.
That's it. The file generated has the dup references.
The source is mainframe DB2.
We have not changed anything rcently except moving to
the 3.2 rc2 version of Torque when it became
available. But that is not the issue.

I suspect something is different on the DB2 side but
the dba's say no. And that's probably where the issue
is and I'm hoping someone ran into the same issue and
can give me a clue as to what I can look for to find
the issue.

Jim 


--- Thomas Fischer <fi...@seitenbau.net> wrote:

> Could you please give a short description of what
> you do ? I don't have a
> clue.
> 
>     Thomas
> 
> Jim <sm...@yahoo.com> schrieb am 06.03.2008
> 19:22:32:
> 
> > Hi,
> > I started running into a duplicate reference in
> the
> > foreign-key issue several months ago in the ant
> > generated schema.xml file.
> > We are still using the 3.2 rc2 version of Torque
> and
> > the tables are DB2.
> >
> > Here is an example of the dup reference..
> > <foreign-key foreignTable="TABLE2">
> >    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> >    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> > </foreign-key>
> >
> > Here is a portion the table that has the
> forigh-key..
> > <table name="TABLE2">
> >         <column name="OFFRG_N" primaryKey="true"
> > required="true" size="12" type="CHAR"/>
> >
> > The dba's swear there have been no changes to the
> DB2
> > tables.
> >
> > Thanks for any suggestions!
> > Jim
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
> 
> 



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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


RE: Duplicate references in the foreign-key

Posted by Thomas Fischer <fi...@seitenbau.net>.
Could you please give a short description of what you do ? I don't have a
clue.

    Thomas

Jim <sm...@yahoo.com> schrieb am 06.03.2008 19:22:32:

> Hi,
> I started running into a duplicate reference in the
> foreign-key issue several months ago in the ant
> generated schema.xml file.
> We are still using the 3.2 rc2 version of Torque and
> the tables are DB2.
>
> Here is an example of the dup reference..
> <foreign-key foreignTable="TABLE2">
>    <reference foreign="OFFRG_N" local="OFFRG_N"/>
>    <reference foreign="OFFRG_N" local="OFFRG_N"/>
> </foreign-key>
>
> Here is a portion the table that has the forigh-key..
> <table name="TABLE2">
>         <column name="OFFRG_N" primaryKey="true"
> required="true" size="12" type="CHAR"/>
>
> The dba's swear there have been no changes to the DB2
> tables.
>
> Thanks for any suggestions!
> Jim


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