Assigning Foreign Key names in Conceptual Model

I occasionally want to override the foreign key name so that it is
something other than the parent key name. Can anyone suggest a foreign
key naming template which will allow this without having to make
changes across the entire conceptual model? I don't want to have to
manually specify every foreign key name, just have the ability to
override when needed.
1
az
7/16/2008 4:28:41 AM
sybase.powerdesigner.general 9408 articles. 1 followers. Follow

4 Replies
4884 Views

Similar Articles

[PageSpeed] 53

On Jul 15, 10:28 pm, az <andrew.za...@gmail.com> wrote:
>  Can anyone suggest a foreign
> key naming template which will allow this without having to make
> changes across the entire conceptual model?

In the CDM, you can add a role to the relationship.  When you gen the
physical, on the detail tab of the gen options window, paste in the
following template [%PROLE%=%PARENT%?:%PROLE%_]%COLUMN%  and select
"always use template".  Results are that if the role exists, it will
prepend the role to the column name from the parent entity to create
the fk column in the child entity.  if there isn't a role, it uses the
same name and code as the parent to create the fk in the child.

use as template:  [%PROLE%=%PARENT%?:%PROLE%_]%COLUMN%
syntax for the template is:
[%V1%=%V2%?if_true:if_false]


0
JaneAnn
7/16/2008 1:42:20 PM
> I occasionally want to override the foreign key name so
> that it is something other than the parent key name. Can
> anyone suggest a foreign key naming template which will
> allow this without having to make changes across the
> entire conceptual model? I don't want to have to manually
> specify every foreign key name, just have the ability to
> override when needed.

I'm curious; do you have a rule you follow that indicates
when the name needs to be different? For example, is it
limited to specific model situations, such as dual FK's
between parent and child, or some other definable condition.

Second, when the need to handle naming differently occurs,
is there a naming convention which has a pattern that you
follow to resolve the modified name. For example, you may
add a suffix of prefix to the original FK name to derive as
new name.

I know it n ight seem odd to not get an answer to your
question, instead getting more questions. I ask as it is
possible you have specific needs that are more than just a
simple name override option.

BTW, is there any related changes to the FK columns when you
need to change the FK name?

Thanks,
Bill
0
Bill
7/16/2008 1:52:05 PM
On Jul 16, 11:42=A0pm, JaneAnn <jane.cad...@fedex.com> wrote:
> On Jul 15, 10:28 pm, az <andrew.za...@gmail.com> wrote:
>
> > =A0Can anyone suggest a foreign
> > key naming template which will allow this without having to make
> > changes across the entire conceptual model?
>
> In the CDM, you can add a role to the relationship. =A0When you gen the
> physical, on the detail tab of the gen options window, paste in the
> following template [%PROLE%=3D%PARENT%?:%PROLE%_]%COLUMN% =A0and select
> "always use template". =A0Results are that if the role exists, it will
> prepend the role to the column name from the parent entity to create
> the fk column in the child entity. =A0if there isn't a role, it uses the
> same name and code as the parent to create the fk in the child.
>
> use as template: =A0[%PROLE%=3D%PARENT%?:%PROLE%_]%COLUMN%
> syntax for the template is:
> [%V1%=3D%V2%?if_true:if_false]

Thanks, that looks like just what I want, but where do I specify the
role? I have had a look through the tabs on the relationship but I
can't spot a "role" anywhere.
0
az
7/17/2008 12:43:32 AM
On Jul 16, 11:52=A0pm, Bill Bunke wrote:
> > I occasionally want to override the foreign key name so
> > that it is something other than the parent key name. Can
> > anyone suggest a foreign key naming template which will
> > allow this without having to make changes across the
> > entire conceptual model? I don't want to have to manually
> > specify every foreign key name, just have the ability to
> > override when needed.
>
> I'm curious; do you have a rule you follow that indicates
> when the name needs to be different? For example, is it
> limited to specific model situations, such as dual FK's
> between parent and child, or some other definable condition.
>
> Second, when the need to handle naming differently occurs,
> is there a naming convention which has a pattern that you
> follow to resolve the modified name. For example, you may
> add a suffix of prefix to the original FK name to derive as
> new name.
>
> I know it n ight seem odd to not get an answer to your
> question, instead getting more questions. I ask as it is
> possible you have specific needs that are more than just a
> simple name override option.
>
> BTW, is there any related changes to the FK columns when you
> need to change the FK name?
>
> Thanks,
> Bill

Bill,
thanks for your questions :)

There are two instances:
- dual foreign keys as you indicated. e.g. app_state references
state_code twice. once as from_state and once as to_state
- occasionally the fk name is not expressive enough. e.g. we are
referencing a generic office table but want the foreign key name to be
audit_office_id rather than just office_id

Andrew
0
az
7/17/2008 12:58:36 AM
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 ...

PowerDesigner Conceptual modeling/Physical modeling...when to do it
We're trying to understand when in the development life cycle conceptual modeling should take place. I'm hoping someone on this list can give me some advice or point me to a good source for this sort of information. The development process for us appears it should be... 1. Gather business requirements 2. Write a Functional Spec 3. Write a Technical Spec 4. Code But where in the above 4 steps do we do the DB modeling? Is conceptual in 1&2 and physical in 2&3? Please advise. We do conceptual modeling (CDM) during the Business Requirements Gathering and Func...

Speciying foregin key attribute name in Conceptual Model (CM)
From my understanding, foreign key columns are not specified in the CM (they are implicitly defined in the relationship). This is fine if one wants the PM column name of the foreign key to be the same name as the Primary Key in the parent table. But suppose I want two tables to eventually look like this in the PM: DEPARTMENT: Dept_No CHAR(3) Primary Key Department_Manager INTEGER Foreign Key to Employee table (other columns) EMPLOYEE: Employee_Id INTEGER Primary Key Dept_No CHAR(3) Foreign Key to Department table (other columns) In the CM, I do not explicitly define t...

How to create Logical model with powerdesigner 11.1. ( Not Conceptual model)
We bought powerdesigner 11.1 and using oracle Db 10g rel 2. I would like create Logical model ( LDM) file and then convert this LDM to PDM. But with this PD only can create CDM(conceptual) and then convert to PDM. There is not option given to convert from CDM to LDM adn then LDM to PDM. I would like create non-identifying type relationship and also use rolename column in my child table instead same column of parent table. please let me know if someone have answer for this . thank you very much. jitendra.rana@bofasecurities.com The way PowerDesigner implements the LDM is with a spec...

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

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

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

Assigning foreign keys in code.
I am quite new, and though I have purchased and viewed several videos, I cannot figure out the answer to this embarrasingly simple data problem.  I have changed the names of the 2 tables and fields for ease.  This is all for a button click event: SqlDataSource1.InsertCommand = "INSERT INTO [orders] ([o_detail1], [o_detail2]) VALUES (@o_detail1, @o_detail2)";SqlDataSource1.InsertParameters.Add("o_detail1", textbox1.text);SqlDataSource1.InsertParameters.Add("o_detail2", textbox2.text); SqlDataSource1.Insert(); // The above code works fine. ...

Naming of foreign keys in the PDM
When I have relationships between two tables, I cannot influence the name of the foreign key field which is generated. Example: I have two tables: customer, user I have two user references in the customer table, the user who manages the customer and the user who created the customer record. When I generate the PDM I always get the field names "id_user" and "id_user2" which are not really useful. I would prefer "managing_user" and "creation_user". Is there a way to influence these names? Regards, Martin -- Martin Matt Neudorfstr...

Assign a foreign key as a parameter
hi everybody I have the following asp.net2.0 codeSelectCommand = "Select IDEmp, FirstName,MiddleName,LastName, Date,HoursNumber, Description From Employee, WorkOnCategory , CatDesignItemReference where IDEmp =IDEmplWork AND FirstName = @FirstName AND Category = @AnyCategory AND ">   <SelectParameters> <asp:ControlParameter ControlID="txtEmployeeName" DefaultValue="" Name="FirstName" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="DropDownList1" DefaultValue="" N...

RoleId/Name as Foreign Key
I'm trying to create a relational SQL data table where one of the foreign keys relates to the aspnet_Roles table.At first, I was linking to the RoleId field because it was the primary key, but that's no good because I can't retrieve the RoleId of a RoleName from my code. I then read this post:http://forums.asp.net/p/1077364/1585594.aspx#1585594 How do I reference the RoleName field as a foreign key? I tried doing it but because RoleName isn't a Primary Key or 'Unique', it won't let me do it.I get the following message:'The columns in table 'aspnet_R...

DA and foreign key names
When generating the physical data model, DA will rename a column which has a foreign key (so that the column name is the same as the foreign key column name). Is there a way to disable this ? Scott...... Scott Cunningham wrote: > > When generating the physical data model, DA will rename a column which has > a foreign key (so that the column name is the same as the foreign key > column name). Is there a way to disable this ? > > Scott...... I would sure like to know how as well!!! We've been renaming the FK columns to an appropriate name on the first ge...

Web resources about - Assigning Foreign Key names in Conceptual Model - sybase.powerdesigner.general

Conceptual schema - Wikipedia, the free encyclopedia
A conceptual schema or conceptual data model is a map of concepts and their relationships used for databases . This describes the semantics of ...

Patsaouras Plaza Connector (Conceptual Plan) - Flickr - Photo Sharing!
Conceptual Plan for Patsaouras Plaza Connector platforms for El Monte Busway

Gravity Inverse Square Law Conceptual Exam Questions- YouTube
If the distance between the masses increases by a factor "n", then the gravity force goes down by a factor "n^2". If the distance decreases by ...

Lost in Yoko Ono's labyrinth of conceptual art
Lost in Yoko Ono's labyrinth of conceptual art

Big Idea: How conceptual cities of the future could float, walk or fry
If the ancient city was an egg, as British architect Cedric Price put it, its modern equivalent is fried.

Conceptual Artists Get Their Chance to (Poorly) Separate Oreo Cookies - Adweek
"Maybe you should just use a knife." That's one of the less charitable reactions to this latest Oreo Separators video from Wieden + Kennedy—part ...

The Conceptual AIRE Mask Charges Your iPhone With Your Breath
... ideas like the AIRE could help push us in the right direction. Would you use the AIRE if it existed? [via The Huffington Post ] The Conceptual ...

Richard Prince Is Selling Conceptual Instagram Art at Gagosian
Richard Prince is turning his Instagram notoriety in his favor yet again, selling the works through Gagosian.

Honda to show off conceptual new Ridgeline truck at SEMA
Filed under: Aftermarket , 2015 SEMA Show , Honda Among the various modified vehicles that Honda has lined up for the SEMA show in Las Vegas ...

"Two years ago, the Smithsonian Institution acquired a conceptual work by Chilean artist Alfredo Jaar ...
"The piece — titled 'Life Magazine, April 19, 1968' — is one of Jaar’s lesser-known works, produced when he was culling through the archives ...

Resources last updated: 2/3/2016 9:28:35 PM