Skip to content

Commit 3ce19b8

Browse files
committed
Regen after recent template improvements.
1 parent ef36915 commit 3ce19b8

3 files changed

Lines changed: 72 additions & 30 deletions

File tree

SRC/LIBRARY/DepartmentSqlIO.dbl

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import Synergex.SynergyDE.Select
1616
.include "DEPARTMENT" repository, structure="strDepartment", end
1717
.endc
1818

19+
.define writelog(x) if ^passed(a_logchannel) && a_logchannel && %chopen(a_logchannel) writes(a_logchannel,%string(^d(now(1:14)),"XXXX-XX-XX XX:XX:XX ") + x)
20+
.define writett(x) if ^passed(a_ttchannel) && a_ttchannel writes(a_ttchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
21+
1922
;;*****************************************************************************
2023
;;; <summary>
2124
;;; Determines if the Department table exists in the database.
@@ -319,8 +322,6 @@ function DepartmentIndex, ^val
319322
sql ,string ;;SQL statement
320323
endrecord
321324

322-
.define writelog(x) writes(a_logchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
323-
324325
proc
325326
init local_data
326327
ok = true
@@ -345,7 +346,7 @@ proc
345346
if (ok)
346347
begin
347348
now = %datetime
348-
writelog("Setting database timeout to " + %string(a_bl_timeout) + " seconds")
349+
writelog(" - Setting database timeout to " + %string(a_bl_timeout) + " seconds")
349350
if (%ssc_cmd(a_dbchn,,SSQL_TIMEOUT,%string(a_bl_timeout))==SSQL_FAILURE)
350351
begin
351352
ok = false
@@ -358,9 +359,6 @@ proc
358359

359360
if (ok && !%IndexExists(a_dbchn,"IX_Department_DeptManager",errtxt))
360361
begin
361-
now = %datetime
362-
writelog(" - Adding index IX_Department_DeptManager")
363-
364362
sql = 'CREATE INDEX IX_Department_DeptManager ON "Department"("DeptManager" ASC)'
365363

366364
call open_cursor
@@ -370,6 +368,18 @@ proc
370368
call execute_cursor
371369
call close_cursor
372370
end
371+
372+
now = %datetime
373+
374+
if (ok) then
375+
begin
376+
writelog(" - Added index IX_Department_DeptManager")
377+
end
378+
else
379+
begin
380+
writelog(" - ERROR: Failed to add index IX_Department_DeptManagers")
381+
ok = true
382+
end
373383
end
374384

375385

@@ -404,7 +414,7 @@ proc
404414
;;Set the database timeout back to the regular value
405415

406416
now = %datetime
407-
writelog("Resetting database timeout to " + %string(a_db_timeout) + " seconds")
417+
writelog(" - Resetting database timeout to " + %string(a_db_timeout) + " seconds")
408418
if (%ssc_cmd(a_dbchn,,SSQL_TIMEOUT,%string(a_db_timeout))==SSQL_FAILURE)
409419
nop
410420

@@ -1961,9 +1971,6 @@ function DepartmentBulkLoad, ^val
19611971
now, a20
19621972
endrecord
19631973

1964-
.define writelog(x) writes(a_logchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
1965-
.define writett(x) if ^passed(a_ttchannel) && a_ttchannel writes(a_ttchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
1966-
19671974
proc
19681975

19691976
init local_data

SRC/LIBRARY/EmployeeSqlIO.dbl

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import Synergex.SynergyDE.Select
1616
.include "EMPLOYEE" repository, structure="strEmployee", end
1717
.endc
1818

19+
.define writelog(x) if ^passed(a_logchannel) && a_logchannel && %chopen(a_logchannel) writes(a_logchannel,%string(^d(now(1:14)),"XXXX-XX-XX XX:XX:XX ") + x)
20+
.define writett(x) if ^passed(a_ttchannel) && a_ttchannel writes(a_ttchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
21+
1922
;;*****************************************************************************
2023
;;; <summary>
2124
;;; Determines if the Employee table exists in the database.
@@ -331,8 +334,6 @@ function EmployeeIndex, ^val
331334
sql ,string ;;SQL statement
332335
endrecord
333336

334-
.define writelog(x) writes(a_logchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
335-
336337
proc
337338
init local_data
338339
ok = true
@@ -357,7 +358,7 @@ proc
357358
if (ok)
358359
begin
359360
now = %datetime
360-
writelog("Setting database timeout to " + %string(a_bl_timeout) + " seconds")
361+
writelog(" - Setting database timeout to " + %string(a_bl_timeout) + " seconds")
361362
if (%ssc_cmd(a_dbchn,,SSQL_TIMEOUT,%string(a_bl_timeout))==SSQL_FAILURE)
362363
begin
363364
ok = false
@@ -370,9 +371,6 @@ proc
370371

371372
if (ok && !%IndexExists(a_dbchn,"IX_Employee_EmpDept",errtxt))
372373
begin
373-
now = %datetime
374-
writelog(" - Adding index IX_Employee_EmpDept")
375-
376374
sql = 'CREATE INDEX IX_Employee_EmpDept ON "Employee"("EmpDept" ASC)'
377375

378376
call open_cursor
@@ -382,15 +380,24 @@ proc
382380
call execute_cursor
383381
call close_cursor
384382
end
383+
384+
now = %datetime
385+
386+
if (ok) then
387+
begin
388+
writelog(" - Added index IX_Employee_EmpDept")
389+
end
390+
else
391+
begin
392+
writelog(" - ERROR: Failed to add index IX_Employee_EmpDepts")
393+
ok = true
394+
end
385395
end
386396

387397
;;Create index 2 (Last name)
388398

389399
if (ok && !%IndexExists(a_dbchn,"IX_Employee_EmpLastName",errtxt))
390400
begin
391-
now = %datetime
392-
writelog(" - Adding index IX_Employee_EmpLastName")
393-
394401
sql = 'CREATE INDEX IX_Employee_EmpLastName ON "Employee"("EmpLastName" ASC)'
395402

396403
call open_cursor
@@ -400,15 +407,24 @@ proc
400407
call execute_cursor
401408
call close_cursor
402409
end
410+
411+
now = %datetime
412+
413+
if (ok) then
414+
begin
415+
writelog(" - Added index IX_Employee_EmpLastName")
416+
end
417+
else
418+
begin
419+
writelog(" - ERROR: Failed to add index IX_Employee_EmpLastNames")
420+
ok = true
421+
end
403422
end
404423

405424
;;Create index 3 (State)
406425

407426
if (ok && !%IndexExists(a_dbchn,"IX_Employee_StateCode",errtxt))
408427
begin
409-
now = %datetime
410-
writelog(" - Adding index IX_Employee_StateCode")
411-
412428
sql = 'CREATE INDEX IX_Employee_StateCode ON "Employee"("EmpAddressState" ASC)'
413429

414430
call open_cursor
@@ -418,15 +434,24 @@ proc
418434
call execute_cursor
419435
call close_cursor
420436
end
437+
438+
now = %datetime
439+
440+
if (ok) then
441+
begin
442+
writelog(" - Added index IX_Employee_StateCode")
443+
end
444+
else
445+
begin
446+
writelog(" - ERROR: Failed to add index IX_Employee_StateCodes")
447+
ok = true
448+
end
421449
end
422450

423451
;;Create index 4 (Zip code)
424452

425453
if (ok && !%IndexExists(a_dbchn,"IX_Employee_ZipCode",errtxt))
426454
begin
427-
now = %datetime
428-
writelog(" - Adding index IX_Employee_ZipCode")
429-
430455
sql = 'CREATE INDEX IX_Employee_ZipCode ON "Employee"("EmpAddressZip" ASC)'
431456

432457
call open_cursor
@@ -436,6 +461,18 @@ proc
436461
call execute_cursor
437462
call close_cursor
438463
end
464+
465+
now = %datetime
466+
467+
if (ok) then
468+
begin
469+
writelog(" - Added index IX_Employee_ZipCode")
470+
end
471+
else
472+
begin
473+
writelog(" - ERROR: Failed to add index IX_Employee_ZipCodes")
474+
ok = true
475+
end
439476
end
440477

441478

@@ -470,7 +507,7 @@ proc
470507
;;Set the database timeout back to the regular value
471508

472509
now = %datetime
473-
writelog("Resetting database timeout to " + %string(a_db_timeout) + " seconds")
510+
writelog(" - Resetting database timeout to " + %string(a_db_timeout) + " seconds")
474511
if (%ssc_cmd(a_dbchn,,SSQL_TIMEOUT,%string(a_db_timeout))==SSQL_FAILURE)
475512
nop
476513

@@ -2204,9 +2241,6 @@ function EmployeeBulkLoad, ^val
22042241
now, a20
22052242
endrecord
22062243

2207-
.define writelog(x) writes(a_logchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
2208-
.define writett(x) if ^passed(a_ttchannel) && a_ttchannel writes(a_ttchannel," - " + %string(^d(now(9:8)),"XX:XX:XX.XX ") + x)
2209-
22102244
proc
22112245

22122246
init local_data

SRC/TEMPLATES/SqlIO.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2965,12 +2965,13 @@ GetExceptionDetails,
29652965
begin
29662966
;;Download the error file
29672967
data exceptionRecords, [#]string
2968+
data errorMessage, string
29682969
29692970
now = %datetime
29702971
writelog("Downloading remote exceptions log file")
29712972
writett("Downloading remote exceptions log file")
29722973
2973-
if (fsc.DownloadText(remoteExceptionsLog,exceptionRecords))
2974+
if (fsc.DownloadText(remoteExceptionsLog,exceptionRecords,errorMessage))
29742975
begin
29752976
data ex_ch, int
29762977
data exceptionRecord, string

0 commit comments

Comments
 (0)