Discussion:
Column code - a way to check its name against a repository ?
(too old to reply)
Steve Schiltz
2010-10-25 19:19:04 UTC
Permalink
Dear all,

I have the following situation:

Our DBA established some kind of naming convention for the columns to
have. For example:
Code would be COD
Risk would be RSK

which gives at the end something like CODRSK for the column holding
the customer risk.

and so on

Sometimes, since the column names are codes manually in Powerdesigner,
some mistakes happen, inverting f.i. simply two letters of. All of the
available 3-letter codes exist, either in an Excel sheet or a flat
file.

Is there any way to create some kind of rule to Poeerdesigner check
the code of a column against this "repository", either immediately
when keying in the name or later at model check?

Any ideas?

Regards

Steve
rkkier
2010-10-25 21:28:37 UTC
Permalink
Just to clarify, you're already using a conversion table to generate
the codes and it looks like your codes don't have spaces between
them? If that's the case, then I think your best option is to
actually check the NAME of an object against the name column in your
model since it'll be easier to parse the names than the concatenated
codes. I'm sure it could be done but I wanted to make sure we're
solving the right problem.
Steve Schiltz
2010-10-26 06:53:54 UTC
Permalink
In fact I'm not using a conversion column. By the way this seems to be
quite difficult to handle in our case, but anyway I'll have a look
into it.
And yes, there are no spaces in the column code.

Regards

Steve
rkkier
2010-10-27 13:13:31 UTC
Permalink
So doing the conversion would be pretty easy using built in
functionality but I don't see any easy way to raise an error when the
name/code conversion takes place. The built in .convert_name macro
doesn't have a return value you can test (at least as far as I know).

If you select your name/code table to the model in the naming
conventions and put the snip below in your name to code conversion
properties, you'll get the conversion you want:

.foreach_part(%Name%)
.convert_name(%CurrentPart%,"_","'-/'")
.next

You can write a custom check on the column object (see the customizing
and extending manual) that parses each name into individual words,
opens up the Excel spreadsheet (several good examples of reading Excel
files on the forums here) and loops through looking for a match. You
can have it raise a warning for any words if finds that aren't on the
list.
Steve Schiltz
2010-10-28 06:14:05 UTC
Permalink
Hi,

that's seems to be be pretty good way of checking the column codes! I
put already in place the conversion table. I'll try it out these days
and let you know about the experience.
Thank's a lot!
Steve

Loading...