How to dump _User tables and sequence values

Hi,

As part of Progress DB dump in Linux OS, I would like know is there any command or script or procedure to take dump of _user tables and sequence values?

I am trying to make it an automated script in Linux. Please suggest me.

Cheers,
Madhu.
 

RealHeavyDude

Well-Known Member
The problem with the sequence current values is that the code still uses static access to the sequences ( compiled on-the-fly ) which means you need to have a developer license of some sort installed in order to be able to dump them. The procedure that does it is called _dmpseqs.p which you can find in src/prodict ( you might need to extract the prodict.pl first ). You can easily adopt the logic that it uses dynamic access to the sequence so that it does not need to be compiled on-the-fly. Have a look on the DYNAMIC-CURRENT-VALUE statement.

Heavy Regards, RealHeavyDude.
 
The problem with the sequence current values is that the code still uses static access to the sequences ( compiled on-the-fly ) which means you need to have a developer license of some sort installed in order to be able to dump them. The procedure that does it is called _dmpseqs.p which you can find in src/prodict ( you might need to extract the prodict.pl first ). You can easily adopt the logic that it uses dynamic access to the sequence so that it does not need to be compiled on-the-fly. Have a look on the DYNAMIC-CURRENT-VALUE statement.

Heavy Regards, RealHeavyDude.


Thanks for the reply.
In my progress 11.2 version, I have found prodict/dmpseqvals.p instead prodict/_dmpseqs.p. I am calling this procedure as below,

/** dump_seq.p **/
def var v-dest-dir as char no-undo.
def stream strm.
assign v-dest-dir = os-getenv("DEFAULTDEST").
run prodict/dmpseqvals.p
(input "ALL",
input (v-dest-dir),
input ?).

quit.
/** dump_seq.p **/

When i run this as # mpro /skp/db/apprules/apprules -b -p /opt/v112/src/dump_seq.p
It is giving below error,
"Procedure /opt/v112/src/dump_seq.p passed parameters to prodict/dmpseqvals.p, which did not expect any. (1005)"

If i remove the parameters its giving error as, "** Unable to open file: . Errno=2. (98)"

Can you please help me where is the problem?
 

RealHeavyDude

Well-Known Member
From what I know - I did this some 5 years ago - the problem is a little more complex. Most of the procedures from prodict heavily rely on GLOBAL SHARED variables ( which, IMHO of course, never was good practice - but that's something Progress itself is notorious for: Utilizing bad practice in the code and samples they provide ... ). In the end I gave up using what Progress provides for dumping and/or loading the sequence current values . In order to solve all this issues I needed to completely roll my own:

Unfortunately - I order to not risk my job - I am not allowed to post any code here, therefore I am only able to describe what I did:
  • I Built a dynamic query against the _Sequence table
  • I use the DYNAMIC-CURRENT-VALUE function for each record in the _Sequence table to fetch the current value of the sequence
  • I expor the sequence name and the current value to a file
I hope you get the idea.

Heavy Regards, RealHeavyDude.
 
Top