0

I have a table with ten fields, f1 (being an integer field) to f10 (being a character field). In between there are other integer, character and date fields.

I would like to copy those field definitions to another table, without needing to re-write the whole definitions. I'm working with the Data Dictionary, who seems not to cover this feature.

Edit after first answer
The first answer mentions how to do this at runtime, but I'm specifically looking for a solution at design-time.

Edit
I've found there are different commandline utilities which can be used for working with Progress database: ProDB for creating a new database, ProUtil for doing several tasks (but I don't find a ProUtil <add a field to a table>).

How can I achieve this?

2
  • If your data dictionary supports domains, this is the way to go. Jan 18 at 11:58
  • I'm afraid it doesn't, Progress is a very old system.
    – Dominique
    Jan 18 at 12:13
1

I would like to copy those field definitions to another table, without needing to re-write the whole definitions.

How about this?

create table t2 as 
select * 
from t1 
where 1 = 2 ; 

OK, it doesn't copy indexes and such like, but it gets you the basic structure, as requested.

I'm working with the Data Dictionary, who seems not to cover this feature.

Given that the job of a Data Dictionary is to manage the structures of other tables, I'd say that's a pretty big hole in its functionality!

6
  • Your answer is useful in case I would like to copy the fields at runtime, but I would like to do this as design-time. Is that possible?
    – Dominique
    Jan 18 at 11:37
  • 1
    If "Design Time" is /inside/ your Data Dictionary, then your Data Dictionary needs to provide a way to do this. I cannot believe it doesn't have so basic a feature. That said, having multiple copies of the /same/ table is generally a Bad Idea. If you are considering any kind of "Table-per-'Thing' Model", then think again. It's /almost always/ a mistake. Modern DBMSs, with features like Partitioning and Row-Level Security, make such a structure redundant.
    – Phill W.
    Jan 18 at 12:03
  • The fields I mention are so-called "Free fields", that can be shown/hidden according to some settings, they are fields per table and they are not shared between different tables.
    – Dominique
    Jan 18 at 12:14
  • So the fields exist on /each/ table and are not shared between tables? Given their names, that seems unlikely, but ... It sounds to me as if you just need a way to get your Data Dictionary to show them to you? In that case, telling us /which one/ you're using might help!
    – Phill W.
    Jan 18 at 12:22
  • The fields exist on several tables, not on all of them. I'd just want to copy them from one table to the other without needing to re-type everything again.
    – Dominique
    Jan 18 at 12:40
0

The Data Dictionary contains the possibility to add a field. Inside that dialog box, there's the possibility to copy a field from another table.

Apparently in there it is possible to copy multiple fields (although being inside the dialog box for one single field, hence my mistake).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.