Consultor Eletrônico



Kbase P18461: How to programatically change db selected to when selected to more than 1 database
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/24/2005
Status: Unverified

GOAL:

How to programmatically "Select Working Database" to perform dump and load using the data dictionary procedures?

GOAL:

How to programmatically dump and load .df and .d files?

FIX:

The Dictionary works only on databases with logical name or alias "DICTDB". To select the working database, use the statement:

CREATE ALIAS DICTDB FOR DATABASE logical-name [ NO-ERROR ].

The following dump and load sample code procedures demonstrate how to select and deselect the current working database using the CREATE ALIAS DICTDB and the DELETE ALIAS DICTDB statements respectively. The DELETE ALIAS statement at the end of each sample is required if dump/load of other databases follow the code.

/* dump.p */

/***Select The Current Working Database***/
CREATE ALIAS DICTDB FOR DATABASE sports.

RUN prodict/dump_df.p ("ALL","sports.df","").
RUN prodict/dump_d.p ("ALL",".","").

/** Deselect The Current Working Database **/
DELETE ALIAS DICTDB. /* Optional */
/* end of dump.p */


/* load.p */
CREATE ALIAS DICTDB FOR DATABASE sports.
RUN prodict/load_df.p ("sports.df").
RUN prodict/load_d.p ("ALL",".").
DELETE ALIAS DICTDB. /* Optional */
/* end of load.p */