mssql_script19.py
1.46 KB
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
import pyodbc
hil_sql = """
create table mpos_report
(
id bigint identity primary key,
doc_type tinyint default 0 not null,
image_count tinyint default 0 not null,
status bit default 1 not null,
duration smallint,
create_time datetime not null
);
ALTER TABLE hil_ocr_report ADD bank_name nvarchar(2048);
ALTER TABLE hil_ocr_report ADD is_ebank bit default 0 not null;
ALTER TABLE hil_ocr_report ADD bs_check_result tinyint default 0 not null;
create table offline_report
(
id bigint identity primary key,
input_folder nvarchar(512) not null,
doc_type tinyint default 0 not null,
file_name nvarchar(1024) not null,
status bit default 1 not null,
failure_reason tinyint default 0 not null,
duration smallint not null,
create_time datetime not null
);
"""
afc_sql = """
ALTER TABLE afc_ocr_report ADD bank_name nvarchar(2048);
ALTER TABLE afc_ocr_report ADD is_ebank bit default 0 not null;
ALTER TABLE afc_ocr_report ADD bs_check_result tinyint default 0 not null;
"""
hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
hil_cursor = hil_cnxn.cursor()
hil_cursor.execute(hil_sql)
hil_cursor.close()
hil_cnxn.close()
afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
afc_cursor = afc_cnxn.cursor()
afc_cursor.execute(afc_sql)
afc_cursor.close()
afc_cnxn.close()