Odyssey
Public Member Functions | List of all members
LoadLnAppData Class Reference
Inheritance diagram for LoadLnAppData:

Public Member Functions

 up ()
 

Detailed Description

Definition at line 9 of file 2018041701_loadLnAppData.php.

Member Function Documentation

◆ up()

LoadLnAppData::up ( )

Load the default TEMPLATE DATA into the lnapp tables

LOCAL VARIABLES

Cleanup the other records. This assumes an initial insert for the lnapp tables


SCHEMA MASTER

LOAD SQL STATEMENT


SCHEMA DETAIL

LOAD SQL STATEMENT

set nextval to be high enough to allow for other templates


ANSWER LOOKUP HEADER

LOAD SQL STATEMENT

set nextval to be high enough to allow for other templates


ANSWER LOOKUP DETAIL

LOAD SQL STATEMENT

set nextval to be high enough to allow for other templates

Definition at line 15 of file 2018041701_loadLnAppData.php.

15  {
16  /**
17  * Load the default TEMPLATE DATA into the lnapp tables
18  *
19  */
20 
21  /**
22  * LOCAL VARIABLES
23  */
24  $skipLoad = false;
25 
26 
27  /**
28  * Cleanup the other records. This assumes an initial insert for the lnapp tables
29  */
30  $sqlDel = "DELETE FROM lnappschemamaster;";
31  $result = $this->execute($sqlDel);
32 
33  $sqlDel = "DELETE FROM lnappschemadetail;";
34  $result = $this->execute($sqlDel);
35 
36 
37  /** ************
38  *
39  * SCHEMA MASTER
40  *
41  */
42 
43  /**
44  * LOAD SQL STATEMENT
45  */
46  $sqlLoad = GetLnappMasterData();
47 
48 
49  $result = $this->execute($sqlLoad);
50  print "*** RESULT lnappschemamaster: $result ***\n";
51 
52  // ** Set skipLoad based on result being 0 (assuming no records inserted)
53  $skipLoad = ($result == 0);
54 
55 
56  if (!$skipLoad) {
57 
58  /** ************
59  *
60  * SCHEMA DETAIL
61  *
62  */
63  /**
64  * LOAD SQL STATEMENT
65  */
66  $sqlLoad = GetLnappDetailData();
67  $result = $this->execute($sqlLoad);
68  print "*** RESULT lnappschemadetail: $result ***\n";
69 
70 
71  /**
72  * set nextval to be high enough to allow for other templates
73  */
74  // * set to 1000
75  $sql = "SELECT SETVAL('lnappschemamaster_loanid_seq', 1000);";
76  $this->execute($sql);
77 
78 
79 
80  /** ************
81  *
82  * ANSWER LOOKUP HEADER
83  *
84  */
85  /**
86  * LOAD SQL STATEMENT
87  */
88  $sqlLoad = GetLnappAnsLookupHeaderData();
89  $result = $this->execute($sqlLoad);
90  print "*** RESULT lnappanslookupheader: $result ***\n";
91 
92  /**
93  * set nextval to be high enough to allow for other templates
94  */
95  // * set to 1000
96  $sql = "SELECT SETVAL('lnappanslookupheader_ansid_seq', 1000);";
97  $this->execute($sql);
98 
99  /** ************
100  *
101  * ANSWER LOOKUP DETAIL
102  *
103  */
104  /**
105  * LOAD SQL STATEMENT
106  */
107  $sqlLoad = GetLnappAnsLookupDetailData();
108  $result = $this->execute($sqlLoad);
109  print "*** RESULT lnappanslookupdetail: $result ***\n";
110 
111  /**
112  * set nextval to be high enough to allow for other templates
113  */
114  // * set to 10000
115  $sql = "SELECT SETVAL('lnappanswerlookupdetail_ansdetailid_seq', 10000);";
116  $this->execute($sql);
117 
118 
119 
120  } else {
121  print "** Skipped loading lnappschemadetail **";
122  }
123 
124  }

The documentation for this class was generated from the following file: