Foreign key names #2

Hi all,

I like to have all my foreign key names set to FK_%PARENT%_%CHILD% so that I
have an idea of what the link is.  When I set this up in Rebuild Indexes, I
get sporadic parent and child table names.

For example, I have 3 tables Template, Customer & Store.  When I set up an
FK between Template (child) and Customer (parent) I get FK_CUSTOMER_STORE.
Sure enough there is an FK between Customer & Store but why is it being
referenced ?



0
Coutta
12/2/1999 12:25:55 AM
sybase.powerdesigner.general 9408 articles. 1 followers. Follow

5 Replies
451 Views

Similar Articles

[PageSpeed] 7

OK, are you wanting to control the names of indexes or foreign key
constraints?

FK Indexes:
You can't use %PARENT% or %CHILD% in this case, since you are dealing with a
single table, and just looking at the reference.
Therefore, you can put %REFR% or %TABLE% in the index, but not %PARENT% or
%CHILD%.
Heck, you might even get something that looks right sometimes, but that is
merely coincidence.

FK Constraints:
You need to edit the definition file, look for this line:
#  Constraint name template for Foreign Keys
FKConstraintName = FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%

The results of changing this are visible from the "Integrity" button in the
Reference Properties dialog box.
Note that you DO have %PARENT% and %CHILD% available in the reference.

This isn't a bug.  Just the way it was designed to work.

--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org


Coutta <spam@hatespam> wrote in message
news:9DPjzAGP$GA.204@forums.sybase.com...
> Hi all,
>
> I like to have all my foreign key names set to FK_%PARENT%_%CHILD% so that
I
> have an idea of what the link is.  When I set this up in Rebuild Indexes,
I
> get sporadic parent and child table names.
>
> For example, I have 3 tables Template, Customer & Store.  When I set up an
> FK between Template (child) and Customer (parent) I get FK_CUSTOMER_STORE.
> Sure enough there is an FK between Customer & Store but why is it being
> referenced ?
>
>
>


0
Michael
12/2/1999 2:22:59 PM
Thanks Michael,

I am trying to control the name of FK indexes, not constraints.

Michael F. Nicewarner [TeamSybase] wrote in message ...
>OK, are you wanting to control the names of indexes or foreign key
>constraints?
>
>FK Indexes:
>You can't use %PARENT% or %CHILD% in this case, since you are dealing with
a
>single table, and just looking at the reference.
>Therefore, you can put %REFR% or %TABLE% in the index, but not %PARENT% or
>%CHILD%.
>Heck, you might even get something that looks right sometimes, but that is
>merely coincidence.
>
>FK Constraints:
>You need to edit the definition file, look for this line:
>#  Constraint name template for Foreign Keys
>FKConstraintName = FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%
>
>The results of changing this are visible from the "Integrity" button in the
>Reference Properties dialog box.
>Note that you DO have %PARENT% and %CHILD% available in the reference.
>
>This isn't a bug.  Just the way it was designed to work.
>
>--
>
>Michael F. Nicewarner [TeamSybase]
>mailto:mike.nicewarner@ibpinc.com
>http://www.datamodel.org
>
>
>Coutta <spam@hatespam> wrote in message
>news:9DPjzAGP$GA.204@forums.sybase.com...
>> Hi all,
>>
>> I like to have all my foreign key names set to FK_%PARENT%_%CHILD% so
that
>I
>> have an idea of what the link is.  When I set this up in Rebuild Indexes,
>I
>> get sporadic parent and child table names.
>>
>> For example, I have 3 tables Template, Customer & Store.  When I set up
an
>> FK between Template (child) and Customer (parent) I get
FK_CUSTOMER_STORE.
>> Sure enough there is an FK between Customer & Store but why is it being
>> referenced ?
>>
>>
>>
>
>


0
Coutta
12/2/1999 10:56:58 PM
OK, then again it is not a bug in the product.  When it is generating an
index, it just doesn't pull in the %PARENT% and %CHILD% variables.

However, this would be an excellent enhancement request.  Have you used
CaseXpress?  You can initiate the process easily from there.

--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org


Coutta <spam@hatespam> wrote in message
news:FO$byzRP$GA.319@forums.sybase.com...
> Thanks Michael,
>
> I am trying to control the name of FK indexes, not constraints.
>
> Michael F. Nicewarner [TeamSybase] wrote in message ...
> >OK, are you wanting to control the names of indexes or foreign key
> >constraints?
> >
> >FK Indexes:
> >You can't use %PARENT% or %CHILD% in this case, since you are dealing
with
> a
> >single table, and just looking at the reference.
> >Therefore, you can put %REFR% or %TABLE% in the index, but not %PARENT%
or
> >%CHILD%.
> >Heck, you might even get something that looks right sometimes, but that
is
> >merely coincidence.
> >
> >FK Constraints:
> >You need to edit the definition file, look for this line:
> >#  Constraint name template for Foreign Keys
> >FKConstraintName = FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%
> >
> >The results of changing this are visible from the "Integrity" button in
the
> >Reference Properties dialog box.
> >Note that you DO have %PARENT% and %CHILD% available in the reference.
> >
> >This isn't a bug.  Just the way it was designed to work.
> >
> >--
> >
> >Michael F. Nicewarner [TeamSybase]
> >mailto:mike.nicewarner@ibpinc.com
> >http://www.datamodel.org
> >
> >
> >Coutta <spam@hatespam> wrote in message
> >news:9DPjzAGP$GA.204@forums.sybase.com...
> >> Hi all,
> >>
> >> I like to have all my foreign key names set to FK_%PARENT%_%CHILD% so
> that
> >I
> >> have an idea of what the link is.  When I set this up in Rebuild
Indexes,
> >I
> >> get sporadic parent and child table names.
> >>
> >> For example, I have 3 tables Template, Customer & Store.  When I set up
> an
> >> FK between Template (child) and Customer (parent) I get
> FK_CUSTOMER_STORE.
> >> Sure enough there is an FK between Customer & Store but why is it being
> >> referenced ?
> >>
> >>
> >>
> >
> >
>
>


0
Michael
12/3/1999 6:02:36 PM
Yes, I'm now aware it's by design.  As you said, it does generate child and
parent entries for the FK index name, but in most cases they're incorrect.

I've never heard of CaseXpress - is it Sybase's enhancement forum ?

Michael F. Nicewarner [TeamSybase] wrote in message ...
>OK, then again it is not a bug in the product.  When it is generating an
>index, it just doesn't pull in the %PARENT% and %CHILD% variables.
>
>However, this would be an excellent enhancement request.  Have you used
>CaseXpress?  You can initiate the process easily from there.
>
>--
>
>Michael F. Nicewarner [TeamSybase]
>mailto:mike.nicewarner@ibpinc.com
>http://www.datamodel.org
>
>
>Coutta <spam@hatespam> wrote in message
>news:FO$byzRP$GA.319@forums.sybase.com...
>> Thanks Michael,
>>
>> I am trying to control the name of FK indexes, not constraints.
>>
>> Michael F. Nicewarner [TeamSybase] wrote in message ...
>> >OK, are you wanting to control the names of indexes or foreign key
>> >constraints?
>> >
>> >FK Indexes:
>> >You can't use %PARENT% or %CHILD% in this case, since you are dealing
>with
>> a
>> >single table, and just looking at the reference.
>> >Therefore, you can put %REFR% or %TABLE% in the index, but not %PARENT%
>or
>> >%CHILD%.
>> >Heck, you might even get something that looks right sometimes, but that
>is
>> >merely coincidence.
>> >
>> >FK Constraints:
>> >You need to edit the definition file, look for this line:
>> >#  Constraint name template for Foreign Keys
>> >FKConstraintName = FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%
>> >
>> >The results of changing this are visible from the "Integrity" button in
>the
>> >Reference Properties dialog box.
>> >Note that you DO have %PARENT% and %CHILD% available in the reference.
>> >
>> >This isn't a bug.  Just the way it was designed to work.
>> >
>> >--
>> >
>> >Michael F. Nicewarner [TeamSybase]
>> >mailto:mike.nicewarner@ibpinc.com
>> >http://www.datamodel.org
>> >
>> >
>> >Coutta <spam@hatespam> wrote in message
>> >news:9DPjzAGP$GA.204@forums.sybase.com...
>> >> Hi all,
>> >>
>> >> I like to have all my foreign key names set to FK_%PARENT%_%CHILD% so
>> that
>> >I
>> >> have an idea of what the link is.  When I set this up in Rebuild
>Indexes,
>> >I
>> >> get sporadic parent and child table names.
>> >>
>> >> For example, I have 3 tables Template, Customer & Store.  When I set
up
>> an
>> >> FK between Template (child) and Customer (parent) I get
>> FK_CUSTOMER_STORE.
>> >> Sure enough there is an FK between Customer & Store but why is it
being
>> >> referenced ?
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>


0
Coutta
12/5/1999 10:17:56 PM
Point your browser to http://casexpress.sybase.com and create a new userid
(if you don't already have one).  That part is FREE.  Once in CaseXpress,
click on the "Enhancement Req" link in the navigation bar on the left.  This
is also FREE.  Enter or verify your contact information and select
PowerDesigner from the list (Should be Family 5 - PowerDesigner) and click
"Continue".  Complete the form (note that PowerDesigner V7 final version is
not listed in the product list at this time, so pick the "beta-3" option.
In the description area, write a SHORT description of what you want (FK
linked indexes should be able to use the %PARENT% and %CHILD% variables).
Submit the form and you're done.  You should get a confirmation screen when
you're done.

Oh, and BTW, you also have an option on the navigation bar to report bugs.
This is also FREE!  :-)  Sybase really does provide good tech support.

Hope this helps.

--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org


Coutta <spam@hatespam> wrote in message
news:2Qw3BM3P$GA.204@forums.sybase.com...
> Yes, I'm now aware it's by design.  As you said, it does generate child
and
> parent entries for the FK index name, but in most cases they're incorrect.
>
> I've never heard of CaseXpress - is it Sybase's enhancement forum ?
>
> Michael F. Nicewarner [TeamSybase] wrote in message ...
> >OK, then again it is not a bug in the product.  When it is generating an
> >index, it just doesn't pull in the %PARENT% and %CHILD% variables.
> >
> >However, this would be an excellent enhancement request.  Have you used
> >CaseXpress?  You can initiate the process easily from there.
> >
> >--
> >
> >Michael F. Nicewarner [TeamSybase]
> >mailto:mike.nicewarner@ibpinc.com
> >http://www.datamodel.org
> >
> >
> >Coutta <spam@hatespam> wrote in message
> >news:FO$byzRP$GA.319@forums.sybase.com...
> >> Thanks Michael,
> >>
> >> I am trying to control the name of FK indexes, not constraints.
> >>
> >> Michael F. Nicewarner [TeamSybase] wrote in message ...
> >> >OK, are you wanting to control the names of indexes or foreign key
> >> >constraints?
> >> >
> >> >FK Indexes:
> >> >You can't use %PARENT% or %CHILD% in this case, since you are dealing
> >with
> >> a
> >> >single table, and just looking at the reference.
> >> >Therefore, you can put %REFR% or %TABLE% in the index, but not
%PARENT%
> >or
> >> >%CHILD%.
> >> >Heck, you might even get something that looks right sometimes, but
that
> >is
> >> >merely coincidence.
> >> >
> >> >FK Constraints:
> >> >You need to edit the definition file, look for this line:
> >> >#  Constraint name template for Foreign Keys
> >> >FKConstraintName = FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%
> >> >
> >> >The results of changing this are visible from the "Integrity" button
in
> >the
> >> >Reference Properties dialog box.
> >> >Note that you DO have %PARENT% and %CHILD% available in the reference.
> >> >
> >> >This isn't a bug.  Just the way it was designed to work.
> >> >
> >> >--
> >> >
> >> >Michael F. Nicewarner [TeamSybase]
> >> >mailto:mike.nicewarner@ibpinc.com
> >> >http://www.datamodel.org
> >> >
> >> >
> >> >Coutta <spam@hatespam> wrote in message
> >> >news:9DPjzAGP$GA.204@forums.sybase.com...
> >> >> Hi all,
> >> >>
> >> >> I like to have all my foreign key names set to FK_%PARENT%_%CHILD%
so
> >> that
> >> >I
> >> >> have an idea of what the link is.  When I set this up in Rebuild
> >Indexes,
> >> >I
> >> >> get sporadic parent and child table names.
> >> >>
> >> >> For example, I have 3 tables Template, Customer & Store.  When I set
> up
> >> an
> >> >> FK between Template (child) and Customer (parent) I get
> >> FK_CUSTOMER_STORE.
> >> >> Sure enough there is an FK between Customer & Store but why is it
> being
> >> >> referenced ?
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>


0
Michael
12/6/1999 2:18:32 PM
Reply:

Similar Artilces:

PowerDesigner
okay this is the issue When you generate the PDM from the CDM, PowerDesigner generates, using its own naming convention, the foreign key column that is placed in the physical model table - we want to have control over this column name ie: we want this foreign key column to be called f_key in our physical table. Please note we are not talking about FK/PKconstraints names etc, we are talking about the actual column name of the foreign key. We have searched through the definition file and cannot find where its being set. Or is this not possible to control in PowerDesigner and you have ...

Primary key
> Je me permet de soliciter une aide sur poweramc V8. > Je suis en charge d'un projet ERP et je me pose la question suivante sur un > exemple de mod�lisation. > > Entit� : ARTICLE > information : Code article > Information : Libell� article > > Entit� : Unit� > Information : Code unit� (exemple : Kg, palette, m2...) > information : Libell� unit� > > Un article a 3 unit�s, unit� de stockage, unit� de vente et unit� d'achat. > Ces trois unit�s peuvent �tre diff�rentes. > > Dans mon MCD, j'...

2
Does anyone know if I can have a table (tbl1) in one database (db1) linked with a foreign key to another table (tbl2) in anther databases (db2) on the same server? db1.tbl1 ==> db2.tbl2 Can tbl1 have triggers to perfrom a cascade delete action on tbl2? in MS SQLServer Marc <mweinstock@lds.com> wrote in message news:wdhAGzFvAHA.260@forums.sybase.com... > Does anyone know if I can have a table (tbl1) in one database (db1) linked > with a foreign key to another table (tbl2) in anther databases (db2) on the > same server? > > db1.tbl1 ==> db2....

foreign keys #2
Can someone explain to me the differences (pros and cons) to define the foreign key with sp_foreignkey versus the use of : ALTER TABLE dbo.tablename ADD CONSTRAINT xxxx_FK1 FOREIGN KEY (col_a) REFERENCES dbo.tablename_b (col_b) thanks ...

Foreign key name
Hi all, I am using PD 11 . The scenario is: when I create two relations between 2 tables (one with role name and the other without role name) then generate the physical model, and use the %PROLE% as FK column name . when the model generates , one FK gest the role name and the others that hadn't role gest the table name as FK. I want to change the default of tabel name to column name is there any one that knows the solotion? regards, The default behavior is for the parent table column name to be used as the FK column. The columns from the first reference should be the ...

Foreign Key Names
I can't seem to figure out where to set the Foreign Key Naming convention. As I generate from a CDM to PDM how do I take control of how relationships are migrated and named. and, what documentation should I read to get a better handle on this? OK, you do not have any control over the default foreign key names in the initial CDM -> PDM generation. However, after you change it in the PDM, the next time you generate PD will abide by your names. -- Michael F. Nicewarner [TeamSybase] psyclo@datamodel.org http://www.datamodel.org "Coy Lay" <coy.lay@acm.c...

Foreign Key #2
I have two tables and the primary key of Table1 is the foreign key of Table2. In Table2 I set the foreign key to not accept null values. Every time I attempt to submit value using a stored procedure I get an error that the foreign key on Table2 cannot accept a null value. So for testing purposes I set the foreign key value to accept a null value. I then checked Table2 after completing an insert and the value of the foreign key was empty. Can anyone tell me what I need to do to make this work correctly or has anyone run into this issue in the past? Thanks for any help provided!  &...

Name Of Foreign Key
I'm using SQL Any50, ORACLE, and SQL Server 6.5 with a PB 6.0 Application. I'm looking for a solution to get the name of the Foreign Key, for some Table of my application. Is there someone who know where i can find it in the system table ? Thank's ETIENNE St�phan Steph -- In Oracle, you need to look at either the ALL_CONSTRAINTS or the USER_CONSTRAINTS view. In SQL Server 6.5, you would look at the SYSREFERENCES table. I'm not sure where you'd look in SQL Anywhere. HTH Ron Gallagher, CPDP Atlanta, GA rongallagher@mindspring.com Steph w...

Foreign Key #2
I have the following problem: - In the model, I have tables with cascade foreign key; - In the database, I have same tables with cascade foreign key; When I generate the script for the updates to apply the bank, the PowerDesigner 12.5 always generates scripts for this tables, saying in model, my foreign key are cascade and in database my foreign key as restrict. What am I doing wrong? Thanks Adriano PS: I'm using: - Sybase PowerDesigner 12.5 - SQL Server 2005 Express - Windows XP SP3 On Oct 20, 10:59=A0am, "Adriano Santos" <adrianogomessa...

Name of foreign key
Hello ! I am working on a program we bought. The previous developpers used PowerAMC and I can't find where they precised the way to name foreign keys. Exemple : if the table "Bill" has a reference to the table "Supplier", when I generate the MPD, the reference is converted this way in the table BILL : ID_SUPPLIER. I want to know where "ID_%TABLE%" is defined ? Otherwise, is it possible for certain foreign keys to define in the MCD the name they will have in the MPD ? Exemple : I have an other table where I want one foreign_key to have a special n...

Foreign keys #2
Hi, I have two tables, Island and Region. EXEC SQL CREATE TABLE Island(islandno integer NOT NULL DEFAULT AUTOINCREMENT, islandarea integer NOT NULL, noofregions integer NOT NULL, primary key(islandno)); EXEC SQL CREATE TABLE Region(regionno integer NOT NULL, islandno , posx integer NOT NULL, posy integer NOT NULL, primary key(regionno,islandno)); In Region, I want the islandno to be a foreign key AND a primary key. How is the foreign key above...

binding 1 gridview to 2 tables having common column(primary key/foreign key)
Hi Friends Can anyone please tell me how to bind to 2 tables having a common column(primarykey/foreign key) to a gridview .the 2 tables have a common column(primarykey/foreign key).I want this in asp.net/vb project.Thank you.Gurjeet,England You can use DataSet, take a look at this link: http://msdn2.microsoft.com/en-us/library/system.data.dataset(d=ide).aspxWelcome to my SQL/ASPNET forum for Chinese http://51up.org/bbs/forumdisplay.php?fid=38...

Cannot drop foreign key constraint in ASE 11.9.2
Hi I need to drop foreign key constraint and drop referenced table, then create another table-parent to be referenced . The problem is that it doesn't allow to drop table because of FKey constraint. When I try to drop the FKey constraint - it doesn't allow this and doesn't give an error message. This problem I experience on production server and this should be fixed urgently but seems like nothing I've tried helps to solve it. I'm using ASE 11.9.2 on NT4.0. If anybody has some ideas it would be very appreciated. Thank you. Ninel <<<< I need to drop ...

Table design question (to foreign key or not to foreign key)
Our application is a message board and is full of messages, threads, and forums. A message is an individual entry (like the one I'm typing now ;)). Our software gives the user the ability to upload a single file attachment to each message. I can think of a couple different ways to design the two tables: message( messageid numeric identity, attachmentid numeric null, messagetext text, other, message, stuff... ) attachment( attachmentid numeric identity, title varchar, other, stuff ) or message( messageid, messagetext text, other, stuff ) attachment( messageid numeric foreig...

Web resources about - Foreign key names #2 - sybase.powerdesigner.general

Foreign Intelligence Surveillance Act of 1978 Amendments Act of 2008 - Wikipedia, the free encyclopedia ...
The FISA Amendments Act of 2008 (also called the Foreign Intelligence Surveillance Act of 1978 Amendments Act of 2008 , H.R. 6304 , enacted 2008-07-10) ...

Old VW Kombi van sells for $158,000 to foreign collector
FORGET classic Ferraris and fine wines. The latest collectors items are old Volkswagen Kombi vans.

Foreign Kidman and Co bids likely to exclude Anna Creek station and include Australian investors
The unsuccessful foreign bidders for the Kidman and Co landholding are working on new bids with Australian investors, the ABC understands.

Cruz Excoriates Rubio on Foreign Policy, Links Him to Clinton
... way between “neo-con” interventionism and isolationism. Ted Cruz on Monday offered his strongest denunciation so far of Marco Rubio's foreign ...

Jeb Bush: Trump is “misinformed at best” on foreign policy - Videos - CBS News
Presidential candidate Gov. Jeb Bush, R-Florida, believes GOP front-runner Donald Trump is preying on the worst fears of Americans. The former ...

Pakistan Attracts $3 Billion Foreign Investment In Renewable Energy
The Pakistani Government’s push towards expansion of renewable energy infrastructure and direct negotiations with foreign governments has yielded ...

'Where is the foreign journalist?': Reporting from the front lines of Syria's ...
CNN International 'Where is the foreign journalist?': Reporting from the front lines of Syria's ... CNN International Editor's note: Kurt ...

Brie Larson & Saoirse Ronan Nab Santa Barbara Co-Honors; Palm Springs Unveils Foreign Film Screenings ...
The Santa Barbara Film Festival has named Room’s Brie Larson and Brooklyn’s Saoirse Ronan as its 2016 Outstanding Performers Of The Year. The ...

New Index Promises Greater Foreign Exchange Transparency
A new index promises to bring greater transparency to the murky foreign exchange market - particularly in middling amounts where most individual ...

On Friday, presumably to burnish his (non-existent) foreign policy credentials, Republican president
On Friday, presumably to burnish his (non-existent) foreign policy credentials, Republican presidential candidate Ben Carson traveled to Jordan ...

Resources last updated: 12/2/2015 4:59:57 PM