class= " lineNumbers " do
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
|
class= do
># notpretty " do class= " do id= " codeSnippet786631 do new ($xls_file);
meu $worksheet = $workbook->addworksheet (da “entradas de jornal afixação”);
meu $worksheet1 = $workbook->addworksheet (“autenticação”);
meu $format1 = $workbook->add_format ();
meu $format2 = $workbook->add_format ();
meu $format3 = $workbook->add_format (=> “mm/dd/yy do num_format ");
$format1->set_size (12);
$format1->set_bold ();
$format1->set_color (“azul ");
$format1->set_align (“centro ");
$format1->set_bg_color (“amarelo ");
#$format2->set_num_format (“general ");
O ############# define o manual de instruções para o ############################### das perguntas do SQL
meu $sql_parser = Spreadsheet:: ParseExcel->new ();
meu $sql_workbook = $sql_parser->parse (“/ms/user/s/sayantag/SQL_Queries.xls”);
meu $sql_worksheet;
############################################################################
meu $col=0;
meu $row=0;
foreach meu $i (
“JRNL_ID”
, “ACCTNG_PERIOD_ID”
, “FCP_ID”
, “LDGR_TYPE_CDE”
, “BA_HRCHY_ID”
, “BA_NID”
, “LE_HRCHY_ID”
, “LE_NID”
, “REGION_HRCHY_ID”
, “REGION_NID”
, “ASSET_ID”
, “QTP_KEY_ID”
, “CHANGE_CTGRY_ID”
, “ELIMINATION_ID”
, “SRC_ID”
, “JRNL_VAL”
, “EFFECTIVE_DTE”
, “RULE_ID”
, “JRNL_SET_ID”
, “CCY”
, “TRANSLATED_CCY”
, “UOM_CCY”
, “RUN_GROUP_ID”
, “BA_CNTRPTY_ID”
, “INTERCPNY_CNTRPTY_ID”
, “REGION_CNTRPTY_ID”
, “TICKET_REF_NO”
, “MASTER_TICKET_REF_NO”
, “HEADER_ID”
)
{
$worksheet->write (0, $col++, $i, $format1);
}
A pergunta de Accesing do ################## do SQL pergunta o ##################### do manual de instruções
para $sql_worksheet ($sql_workbook->worksheets ()) {
meu ($row_min, $row_max) = $sql_worksheet->row_range ();
meu ($col_min, $col_max) = $sql_worksheet->col_range ();
para meu $row ($row_min. $row_max) {for## do ##First
para meu $col ($col_min. $col_max) {for## do ##Second
meu $cell = $sql_worksheet->get_cell ($row, $col);
se ($col==0 && $row! && =0 (eq “Query1” de $sql_worksheet->get_cell ($row, 0))) {
$col++;
meu $query = $sql_worksheet->get_cell ($row, $col) - >value;
##############################################################################
meu $dbh = DBI->connect (“dbi: MSDB2: NQ200001”, '', '', {“RaiseError” => 1}) ou
morrer “não pode conetar à base de dados: $DBI:: errstr”;
meu $sql = “$query”;
meu $sth = $dbh->prepare ($sql);
$sth->execute ();
$row = 1;
quando (meu $a = $sth->fetchrow_hashref ()) {
$worksheet->write ($row, 0, (definido ($a-> {“JRNL_ID”})? $a-> {“JRNL_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 1, (definido ($a-> {“ACCTNG_PERIOD_ID”})? $a-> {“ACCTNG_PERIOD_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 2, (definidos ($a-> {“FCP_ID”})? $a-> {“FCP_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 3, (definidos ($a-> {“LDGR_TYPE_CDE”})? $a-> {“LDGR_TYPE_CDE”}: “[ZERO] "), $format2);
$worksheet->write ($row, 4, (definidos ($a-> {“BA_HRCHY_ID”})? $a-> {“BA_HRCHY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 5, (definidos ($a-> {“BA_NID”})? $a-> {“BA_NID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 6, (definidos ($a-> {“LE_HRCHY_ID”})? $a-> {“LE_HRCHY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 7, (definidos ($a-> {“LE_NID”})? $a-> {“LE_NID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 8, (definidos ($a-> {“REGION_HRCHY_ID”})? $a-> {“REGION_HRCHY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 9, (definidos ($a-> {“REGION_NID”})? $a-> {“REGION_NID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 10, (definidos ($a-> {“ASSET_ID”})? $a-> {“ASSET_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 11, (definidos ($a-> {“QTP_KEY_ID”})? $a-> {“QTP_KEY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 12, (definidos ($a-> {“CHANGE_CTGRY_ID”})? $a-> {“CHANGE_CTGRY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 13, (definidos ($a-> {“ELIMINATION_ID”})? $a-> {“ELIMINATION_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 14, (definidos ($a-> {“SRC_ID”})? $a-> {“SRC_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 15, (definidos ($a-> {“JRNL_VAL”})? $a-> {“JRNL_VAL”}: “[ZERO] "), $format2);
$worksheet->write ($row, 16, (definidos ($a-> {“EFFECTIVE_DTE”})? $a-> {“EFFECTIVE_DTE”}: “[ZERO] "), $format3);
$worksheet->write ($row, 17, (definidos ($a-> {“RULE_ID”})? $a-> {“RULE_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 18, (definidos ($a-> {“JRNL_SET_ID”})? $a-> {“JRNL_SET_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 19, (definidos ($a-> {“CCY”})? $a-> {“CCY”}: “[ZERO] "), $format2);
$worksheet->write ($row, 20, (definidos ($a-> {“TRANSLATED_CCY”})? $a-> {“TRANSLATED_CCY”}: “[ZERO] "), $format2);
$worksheet->write ($row, 21, (definidos ($a-> {“UOM_CCY”})? $a-> {“UOM_CCY”}: “[ZERO] "), $format2);
$worksheet->write ($row, 22, (definidos ($a-> {“RUN_GROUP_ID”})? $a-> {“RUN_GROUP_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 23, (definidos ($a-> {“BA_CNTRPTY_ID”})? $a-> {“BA_CNTRPTY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 24, (definido ($a-> {“INTERCPNY_CNTRPTY_ID”})? $a-> {“INTERCPNY_CNTRPTY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 25, (definidos ($a-> {“REGION_CNTRPTY_ID”})? $a-> {“REGION_CNTRPTY_ID”}: “[ZERO] "), $format2);
$worksheet->write ($row, 26, (definidos ($a-> {“TICKET_REF_NO”})? $a-> {“TICKET_REF_NO”}: “[ZERO] "), $format2);
$worksheet->write ($row, 27, (definidos ($a-> {“MASTER_TICKET_REF_NO”})? $a-> {“MASTER_TICKET_REF_NO”}: “[ZERO] "), $format2);
$worksheet->write ($row, 28, (definidos ($a-> {“HEADER_ID”})? $a-> {“HEADER_ID”}: “[ZERO] "), $format2);
$row++;
}
$sth->finish ();
} o ###End se para o SQL pergunta o ### do manual de instruções
#################################### DA FOLHA DO ###################### SEGUNDO
$col=0;
foreach meu $i (“NUM_ROWS”, “NUM_PROCESSED”, “NUM_FAILED”, “NUM_OUTPUT_ROWS”)
{
$worksheet1->write (0, $col++, $i, $format1);
}
O ##################### Accesing SQL pergunta o ######################### do manual de instruções outra vez
se ($col==0 && $row! && =0 (eq “Query2” de $sql_worksheet->get_cell ($row, 0))) {
$col++;
meu $query = $sql_worksheet->get_cell ($row, $col) - >value;
meu $dbh = DBI->connect (“dbi: MSDB2: NQ230001”, '', '', {“RaiseError” => 1}) ou
morrer “não pode conetar à base de dados: $DBI:: errstr”;
meu $sql = “$query”;
meu $sth = $dbh->prepare ($sql);
$sth->execute ();
$row = 1;
quando (meu $a = $sth->fetchrow_hashref ()) {
$worksheet1->write ($row, 0, $a-> {“NUM_ROWS”}, $format2);
$worksheet1->write ($row, 1, $a-> {“NUM_PROCESSED”}, $format2);
$worksheet1->write ($row, 2, $a-> {“NUM_FAILED”}, $format2);
$worksheet1->write ($row, 3, $a-> {“NUM_OUTPUT_ROWS”}, $format2);
$row++;
}
$sth->finish ();
} #########End se para a segunda vez (para a folha da autenticação da lima gerada original) para o SQL pergunta o ######## do manual de instruções
}
}
}
$workbook->close ();
#exit;
se (- s $xls_file) {
“da cópia \ n \ nFile para ser comparado é gerado com tamanho diferente de zero. \ n \ n”;
}
mais {
“da cópia \ n \ nFile gerado é do zero-tamanho. O reparo de Pls as edições e regenera-os outra vez antes de comparar \ n \ n”;
}
|