gehe zur Dokumentation dieser Datei
6 $BA =
"LOAN"; ## -- leave $BA as empty
string to copy all BA. Otherwise enter 1 BA (no need to quote BA)
7 $STAGES =
""; ## $STAGES =
"STGCAT1,STGCAT2" -- leave $STAGES as empty
string to run all stages. No need to quote stgcats.
10 $USER=
'JCOLLECT_BKRM';
14 # =================================== INCLUDES
16 include_once(
'../adodb.inc.php');
17 include_once(
'adodb-replicate.inc.php');
19 # ==================================== CONNECTION
20 $DB = ADONewConnection(
'oci8');
21 $ok =
$DB->Connect($HOST,$USER,$PWD,$DBASE);
31 $QTY_BA =
" and qu_bacode='$BA'";
32 if (1)
$STP_BA =
" and s_stagecat in (select stg_stagecat from kbstage where stg_bacode='$BA')"; # OLDER KBSTEP
33 else $STP_BA =
" and s_bacode='$BA'"; # LATEST KBSTEP format
34 $STG_BA =
" and stg_bacode='$BA'";
43 $STAGES = explode(
',',$STAGES);
44 $STAGES =
"'".implode(
"','",$STAGES).
"'";
45 $QTY_STG =
" and qu_stagecat in ($STAGES)";
46 $STP_STG =
" and s_stagecat in ($STAGES)";
47 $STG_STG =
" and stg_stagecat in ($STAGES)";
56 /******************************************************************************
58 Migrate stages, steps and qtypes for the following
64 WARNING: DO NOT 'Ignore All Errors'.
65 If any error occurs, make sure you stop and check the reason and fix it.
66 Otherwise you could corrupt everything!!!
68 Connected to $USER@$DBASE $HOST;
70 *******************************************************************************/
73 create table kbstage_$bkup as select * from kbstage;
74 create table kbstep_$bkup as select * from kbstep;
75 create table kbqtype_$bkup as select * from kbqtype;
78 -- IF CODE FAILS, REMEMBER TO RENABLE ALL TRIGGERS and following CONSTRAINT
79 ALTER TABLE kbstage DISABLE all triggers;
80 ALTER TABLE kbstep DISABLE all triggers;
81 ALTER TABLE kbqtype DISABLE all triggers;
82 ALTER TABLE jqueue DISABLE CONSTRAINT QUEUE_MUST_HAVE_TYPE;
85 -- NOW DELETE OLD STEPS/STAGES/QUEUES
86 delete from kbqtype where qu_mode in ('STAGE','STEP') $QTY_BA $QTY_STG;
87 delete from kbstep where (1=1) $STP_BA$STP_STG;
88 delete from kbstage where (1=1)$STG_BA$STG_STG;
92 SET DEFINE OFF; -- disable variable handling by sqlplus
94 /* Assume kbstrategy and business areas are compatible for steps and stages to be copied */
105 $rep->ReplicateData(
'KBSTAGE',
'KBSTAGE', array(),
" where (1=1)$STG_BA$STG_STG");
106 $rep->ReplicateData(
'KBSTEP',
'KBSTEP', array(),
" where (1=1)$STP_BA$STP_STG");
107 $rep->ReplicateData(
'KBQTYPE',
'KBQTYPE',array(),
" where qu_mode in ('STAGE','STEP')$QTY_BA$QTY_STG");
111 -- Check for QUEUES not in KBQTYPE and FIX by copying from kbqtype_$bkup
113 for rec in (select distinct q_type from jqueue where q_type not in (select qu_code from kbqtype)) loop
114 insert into kbqtype select * from kbqtype_$bkup where qu_code = rec.q_type;
115 update kbqtype set qu_name=substr('MISSING.'||qu_name,1,64) where qu_code=rec.q_type;
123 ALTER TABLE kbstage ENABLE all triggers;
124 ALTER TABLE kbstep ENABLE all triggers;
125 ALTER TABLE kbqtype ENABLE all triggers;
126 ALTER TABLE jqueue ENABLE CONSTRAINT QUEUE_MUST_HAVE_TYPE;
129 -- REMEMBER TO COMMIT
131 begin Juris.UpdateQCounts; end;
133 -- To check for bad queues after conversion, run this
134 select * from kbqtype where qu_name like 'MISSING%'
Sie sind hier: Home » MyOOS Benutzerhandbuch » ADOdb
Korrekturen, Hinweise und Ergänzungen
Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag
Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.