Question Automatically load _user records into database

swip

New Member
Hi,

from time to time I need to create a new database and add users to it.
Is there a way to just accomplish this with proEnv only?
I already no that I can use prodb to create a database but for adding users
I need the Database Administration tool which is not convenient.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Note that your subject line doesn't actually describe your need. Something like "Automatically load _user records into database" would be more helpful to future users' searches, if they have a similar problem to solve.

You can automate the loading of _user records. You didn't specify, but when you say "users" I have to assume you mean records in _user.

I assume you have a dump file (_user.d) from some reference database that contains the user records you want to load into the newly-created database. In an ABL session connected to the target database, this statement will load user records from a dump file in the current directory:
Code:
run prodict/load_d.p( "_user", "." ).

Change the "." to some other path, if the file is in another location.

Then it is just a matter of creating a procedure with that line of code, so you can use it as the starting procedure of a batch session. For example, if you save it as load.p, you could do the following:
Code:
bpro dbname -p ./load.p > load.out

This assumes the target database is offline. Otherwise, use mbpro instead of bpro.

You could get fancier and pass in the file name and path via -param, but the above should get you started.
 

swip

New Member
Hi Rob,
now that I read your answer I recognize that I have given too less info.

You are right I want to add users which are dumped to a _user.d file.
I will look into this and I will report back asap.

Thanks!
 
Top