We created some Equation that need to be migrated from one instance to another, and we need to know the steps to do this, other than recreating the equation in each instance.
First of all, for both the equation export/import as well as this sql export/import, the security trees will have to be updated ahead of time in case the target auth classes do not already exist. E.g., to list the auth classes used by a particular EQTN_OPERAND_SQL, you would do the query:
SELECT DISTINCT
EQTN_SQ_AUTH_CLASS
FROM PS_EQTN_SQAUTH_TBL
ORDER BY
EQTN_SQ_AUTH_CLASS
Likewise, for equations:
SELECT DISTINCT
EQTN_ID_AUTH_CLASS
FROM PS_EQTN_ID_NAMAUTH
ORDER BY
EQTN_ID_AUTH_CLASS
This is so that when you import the respective auth table, the security tree node already exists. Auth tables hold the contents of equation security tree nodes.
The datamover script to export the equations would be:
SET LOG EQUATION_EXPORT.LOG;
SET OUTPUT EQUATION.DAT;
EXPORT EQUATION_TBL WHERE EQUATION_NAME = '?';
EXPORT EQUATION_DTL WHERE EQUATION_NAME = '?';
EXPORT EQTN_ID_NAMAUTH WHERE EQUATION_NAME = '?';
The datamover script to import the equations would be:
SET LOG EQUATION_IMPORT.LOG;
SET INPUT EQUATION.DAT;
DELETE FROM PS_EQUATION_PCODE WHERE EQUATION_NAME = '?';
DELETE FROM PS_EQUATION_TBL WHERE EQUATION_NAME = '?';
DELETE FROM PS_EQUATION_DTL WHERE EQUATION_NAME = '?';
DELETE FROM PS_EQTN_ID_NAMAUTH WHERE EQUATION_NAME = '?';
COMMIT;
IMPORT EQUATION_TBL;
IMPORT EQUATION_DTL;
IMPORT EQTN_ID_NAMAUTH;
The datamover export script to export the SQL for the equations would be:
SET LOG EQTNSQL_EXPORT.LOG;
SET OUTPUT EQTNSQL.DAT;
EXPORT EQTN_SQL_TBL
WHERE EQTN_OPERAND_SQL = 'XXXXXXXXX';
EXPORT EQTN_SQL_CHUNKS
WHERE EQTN_OPERAND_SQL = 'XXXXXXXXX';
EXPORT EQTN_SQAUTH_TBL
WHERE EQTN_SQ_AUTH_CLASS = 'XXXXXXXXX';
The import script for the SQL would look like:
SET LOG EQTNSQL_IMPORT.LOG;
SET INPUT EQTNSQL.DAT;
DELETE FROM PS_EQTN_SQL_TBL
WHERE EQTN_OPERAND_SQL = 'XXXXXXXXX';
DELETE FROM PS_EQTN_SQL_CHUNKS
WHERE EQTN_OPERAND_SQL = 'XXXXXXXXX';
DELETE FROM PS_EQTN_SQAUTH_TBL
WHERE EQTN_SQ_AUTH_CLASS = 'XXXXXXXXX';
COMMIT;
IMPORT EQTN_SQL_TBL;
IMPORT EQTN_SQL_CHUNKS;
IMPORT EQTN_SQAUTH_TBL;