39 KiB
39 KiB
In [1]:
import psycopg2
In [2]:
# 数据库连接参数 dbname = "gis_lca" user = "postgres" password = "xxxx" host = "localhost" # 或者是你 Docker 容器的 IP 地址,如果你在不同的机器上 port = "5432" # 连接字符串 conn_string = f"host={host} dbname={dbname} user={user} password={password} port={port}" # 连接到数据库 conn = psycopg2.connect(conn_string) cur = conn.cursor()
In [3]:
from psycopg2 import Error as Psycopg2Error def execute_query(query): # 数据库连接参数 dbname = "gis_lca" user = "postgres" password = "Qibebt+123" host = "localhost" # 或者是你 Docker 容器的 IP 地址,如果你在不同的机器上 port = "5432" # 连接字符串 conn_string = f"host={host} dbname={dbname} user={user} password={password} port={port}" # 连接到数据库 conn = psycopg2.connect(conn_string) cur = conn.cursor() try: # 使用传入的 cursor 执行 SQL 查询 cur.execute(query) # 获取查询结果 results = cur.fetchall() return results except Psycopg2Error as e: # 这里可以打印异常信息,方便调试 print(e) return "error" finally: # 关闭 cursor 和连接 cur.close() conn.close()
In [11]:
res = execute_query("SELECT COUNT(*) FROM tb_process WHERE create_time BETWEEN '2023-06-01' AND '2023-06-15';") print(res)
[(21238,)]
In [13]:
gold = [] pred = [] err_gold = 0 err_pred = 0 err_flag_gold = [] # 1是error,0不是 err_flag_pred = [] with open("./data/Qianfan/gold.txt","r",encoding="utf-8") as f: for line in f.readlines(): gold.append(line.strip()) with open("./data/Qianfan/pred.txt","r",encoding="utf-8") as f: for line in f.readlines(): pred.append(line.strip()) equal = 0 for idx,(g,p) in enumerate(zip(gold,pred)): print("序号:",idx) print("##真实sql:##",) res_g = execute_query(g) print("##预测sql:##") res_p = execute_query(p) if res_g == 'error': err_flag_gold.append(1) else: err_flag_gold.append(0) if res_p == 'error': err_flag_pred.append(1) else: err_flag_pred.append(0) if res_g!='error': equal += (res_g == res_p) if res_g == 'error': err_gold += 1 if res_p == 'error': err_pred += 1 print("error gold:",err_gold) print("error pred:",err_pred) print("correct:",equal)
序号: 0 ##真实sql:## ##预测sql:## 序号: 1 ##真实sql:## ##预测sql:## column "is_deleted" does not exist LINE 1: ...WHERE product_system_id='1298311160348545024' AND is_deleted... ^ HINT: Perhaps you meant to reference the column "tb_process.deleted". 序号: 2 ##真实sql:## ##预测sql:## 序号: 3 ##真实sql:## ##预测sql:## 序号: 4 ##真实sql:## ##预测sql:## 序号: 5 ##真实sql:## ##预测sql:## column "is_deleted" does not exist LINE 1: ...54248748761088' AND id!='1300755365750636544' AND is_deleted... ^ HINT: Perhaps you meant to reference the column "tb_process.deleted". 序号: 6 ##真实sql:## ##预测sql:## 序号: 7 ##真实sql:## ##预测sql:## 序号: 8 ##真实sql:## ##预测sql:## 序号: 9 ##真实sql:## ##预测sql:## 序号: 10 ##真实sql:## ##预测sql:## 序号: 11 ##真实sql:## ##预测sql:## 序号: 12 ##真实sql:## ##预测sql:## 序号: 13 ##真实sql:## ##预测sql:## 序号: 14 ##真实sql:## ##预测sql:## 序号: 15 ##真实sql:## ##预测sql:## 序号: 16 ##真实sql:## ##预测sql:## 序号: 17 ##真实sql:## ##预测sql:## 序号: 18 ##真实sql:## ##预测sql:## 序号: 19 ##真实sql:## ##预测sql:## 序号: 20 ##真实sql:## no results to fetch ##预测sql:## invalid input syntax for type json LINE 1: ...'1301153780011634688', '0', '1276473778162892800', 'JSON字符... ^ DETAIL: Token "JSON字符串" is invalid. CONTEXT: JSON data, line 1: JSON字符串 序号: 21 ##真实sql:## ##预测sql:## column "creator" does not exist LINE 1: ...CT COUNT(*) AS total FROM tb_product_system WHERE creator='1... ^ 序号: 22 ##真实sql:## ##预测sql:## 序号: 23 ##真实sql:## ##预测sql:## 序号: 24 ##真实sql:## ##预测sql:## column "delete_flag" does not exist LINE 1: SELECT COUNT(*) AS total FROM sys_user WHERE delete_flag = '... ^ 序号: 25 ##真实sql:## ##预测sql:## 序号: 26 ##真实sql:## ##预测sql:## 序号: 27 ##真实sql:## ##预测sql:## 序号: 28 ##真实sql:## ##预测sql:## 序号: 29 ##真实sql:## ##预测sql:## 序号: 30 ##真实sql:## ##预测sql:## subquery in FROM must have an alias LINE 1: SELECT COUNT(*) FROM (SELECT * FROM tb_parameter WHERE creat... ^ HINT: For example, FROM (SELECT ...) [AS] foo. 序号: 31 ##真实sql:## ##预测sql:## 序号: 32 ##真实sql:## ##预测sql:## 序号: 33 ##真实sql:## ##预测sql:## 序号: 34 ##真实sql:## ##预测sql:## 序号: 35 ##真实sql:## ##预测sql:## 序号: 36 ##真实sql:## ##预测sql:## 序号: 37 ##真实sql:## ##预测sql:## 序号: 38 ##真实sql:## ##预测sql:## 序号: 39 ##真实sql:## ##预测sql:## 序号: 40 ##真实sql:## ##预测sql:## 序号: 41 ##真实sql:## ##预测sql:## 序号: 42 ##真实sql:## ##预测sql:## 序号: 43 ##真实sql:## ##预测sql:## 序号: 44 ##真实sql:## ##预测sql:## 序号: 45 ##真实sql:## ##预测sql:## 序号: 46 ##真实sql:## ##预测sql:## 序号: 47 ##真实sql:## ##预测sql:## 序号: 48 ##真实sql:## ##预测sql:## 序号: 49 ##真实sql:## ##预测sql:## 序号: 50 ##真实sql:## ##预测sql:## 序号: 51 ##真实sql:## ##预测sql:## 序号: 52 ##真实sql:## ##预测sql:## 序号: 53 ##真实sql:## ##预测sql:## 序号: 54 ##真实sql:## ##预测sql:## 序号: 55 ##真实sql:## ##预测sql:## 序号: 56 ##真实sql:## ##预测sql:## 序号: 57 ##真实sql:## ##预测sql:## 序号: 58 ##真实sql:## ##预测sql:## 序号: 59 ##真实sql:## ##预测sql:## 序号: 60 ##真实sql:## ##预测sql:## 序号: 61 ##真实sql:## ##预测sql:## 序号: 62 ##真实sql:## ##预测sql:## 序号: 63 ##真实sql:## ##预测sql:## 序号: 64 ##真实sql:## ##预测sql:## 序号: 65 ##真实sql:## ##预测sql:## error gold: 1 error pred: 6 correct: 57
In [14]:
equal/(len(gold)-err_gold)
Out[14]:
0.8769230769230769
In [6]:
len(gold)
Out[6]:
66
In [19]:
len(pred)
Out[19]:
89
In [20]:
print(sum(err_flag_gold)) print(sum(err_flag_pred))
42 47
In [21]:
for flag,g in zip(err_flag_gold,gold): if flag == 1: print(g) execute_query(g) print("\n")
update tb_process set name='过程-47', process_type='lci_result', quantitative_reference_id='1281992402172645376', exchange_dq_system_id='129155', location_id='1281992369050226688', process_doc_id='1281992369121529856', tags='', library='custom', product_system_id='1126536120784388096', process_source='1', node_type='0', deleted='0', create_time='2024-09-07t14:59:59.070628', update_time='2024-10-30t14:02:09.854238700', create_user='10014', share='0' where id='1281992369046032384' no results to fetch update tb_process set name='过程-48', process_type='lci_result', quantitative_reference_id='1282004633295785984', dq_entry='(1;3;3;2;4)', dq_system_id='129155', exchange_dq_system_id='129155', location_id='1281995322549080065', process_doc_id='1281995322620383232', tags='未分组', library='custom', product_system_id='1126536120784388096', process_source='1', node_type='0', deleted='0', create_time='2024-09-07t15:11:43.241356', update_time='2024-10-30t14:43:51.905182', create_user='10014', share='0' where id='1281995322549080064' no results to fetch update tb_process set node = jsonb_concat(coalesce(node, '{}'::jsonb), '{"nodelock":true}(pgobject)'::jsonb) where id = '1250448580720721920' invalid input syntax for type json LINE 1: ... node = jsonb_concat(coalesce(node, '{}'::jsonb), '{"nodeloc... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {"nodelock":true}(... update tb_process set name='过程-47', process_type='lci_result', quantitative_reference_id='1281992402172645376', exchange_dq_system_id='129155', location_id='1281992369050226688', process_doc_id='1281992369121529856', tags='', library='custom', product_system_id='1126536120784388096', process_source='1', node='{"nodelock":false}(pgobject)', node_type='0', deleted='0', create_time='2024-09-07t14:59:59.070628', update_time='2024-10-30t14:44:44.194875600', create_user='10014', share='0' where id='1281992369046032384' invalid input syntax for type json LINE 1: ...d='1126536120784388096', process_source='1', node='{"nodeloc... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {"nodelock":false}(... update tb_process set name='过程-42', process_type='lci_result', location_id='1268572768446709761', process_doc_id='1268572768450904064', tags='', library='custom', product_system_id='1126536120784388096', process_source='1', node='{"isshowheader":true}(pgobject)', node_type='0', deleted='0', create_time='2024-08-01t14:15:16.941071', update_time='2024-10-30t14:47:43.063534800', create_user='10014', share='0' where id='1268572768446709760' invalid input syntax for type json LINE 1: ...d='1126536120784388096', process_source='1', node='{"isshowh... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {"isshowheader":true}(... update tb_process set name='组合-8', process_type='lci_result', location_id='1250448580720721921', process_doc_id='1250448580724916224', tags='', product_system_id='1126536120784388096', process_source='1', node='{"nodelock":true,"isshowheader":true}(pgobject)', node_type='1', deleted='0', create_time='2024-06-12t13:56:13.856251', update_time='2024-10-30t14:59:45.406018900', create_user='10014', share='0' where id='1250448580720721920' invalid input syntax for type json LINE 1: ...d='1126536120784388096', process_source='1', node='{"nodeloc... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {"nodelock":true,"isshowheader":true}(... delete from tb_process where (id = '1250455867959017472') no results to fetch update tb_process set ref_id='88887af6-44cd-375d-8cc3-b435e46e7398', name='potassium chloride sludge', synonyms='recycled content cut-off | potassium chloride sludge | cutoff', category_id='u', description='氯化钾污泥,回收含量截止 | 氯化钾污泥', process_type='254', infrastructure_process=' dataset documentation: https://v391.ecoquery.ecoinvent.org/details/upr/52384e73-bd33-4b4a-a92d-dbcabdf3385c/290c1f85-4cc4-4fa1-b0c8-2cb7f4276dce', quantitative_reference_id='unit_process', exchange_dq_system_id='0', location_id='1282027091423920128', process_doc_id='129155', version='1282027091365199873', last_change='1282027091407142912', tags='4295032833', library='0', product_system_id='未分组', process_source='ecoinvent3.9', reference_process_id='1126536120784388096', node_type='1', deleted='43921943', create_time='0', update_time='0', create_user='2024-09-07t17:17:57.493601', share='2024-10-30t17:54:19.352193500' where id='10014' invalid input syntax for type bigint: "u" LINE 1: ... potassium chloride sludge | cutoff', category_id='u', descr... ^ select p.*, f.id as referenceflowid, f.name as referenceflowname, l.name as locationname, lg.level as locationlevel, concat(coalesce(l.latitude, 0), ',', coalesce(l.longitude, 0)) as point from tb_process p left join tb_exchange e on p.quantitative_reference_id = e.id left join tb_flow f on e.flow_id = f.id left join tb_location l on p.location_id = l.id left join tb_location_gis lg on p.location_id = lg.id where p.id = '5441180' relation "tb_location_gis" does not exist LINE 1: ...n tb_location l on p.location_id = l.id left join tb_locatio... ^ insert into tb_process ( id, name, process_type, location_id, process_doc_id, library, product_system_id, node_type, create_user, extend ) values ( '1303019285966229504', '过程-79', 'lci_result', '1303019285966229505', '1303019285995589632', 'custom', '1126536120784388096', '0', '10014', '{}(pgobject)' ) invalid input syntax for type json LINE 1: ...', 'custom', '1126536120784388096', '0', '10014', '{}(pgobje... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {}(... update tb_process set name='过程-80', process_type='lci_result', location_id='1303019504111980545', process_doc_id='1303019504141340672', tags='', library='custom', product_system_id='1126536120784388096', process_source='1', node_type='0', deleted='0', create_time='2024-11-04t15:34:18.861338', update_time='2024-11-04t15:34:20.999744100', create_user='10014', extend='{}(pgobject)', share='0' where id='1303019504111980544' invalid input syntax for type json LINE 1: ...t15:34:20.999744100', create_user='10014', extend='{}(pgobje... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {}(... update tb_process set quantitative_reference_id='1303021651771789312' where (id = '1303019504111980544' and quantitative_reference_id is null) no results to fetch update tb_process set name='过程-80', process_type='lci_result', quantitative_reference_id='1303021651771789312', location_id='1303019504111980545', process_doc_id='1303019504141340672', tags='', library='custom', product_system_id='1126536120784388096', process_source='1', node_type='0', deleted='0', create_time='2024-11-04t15:34:18.861338', update_time='2024-11-04t16:02:34.093388700', create_user='10014', extend='{}(pgobject)', share='0' where id='1303019504111980544' invalid input syntax for type json LINE 1: ...t16:02:34.093388700', create_user='10014', extend='{}(pgobje... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: {}(... update tb_process set name='过程-50', process_type='lci_result', location_id='1301203324149694465', process_doc_id='1301203324153888768', tags='', library='custom', product_system_id='1126536120784388096', process_source='1', node='{"x":612,"y":12,"width":180,"height":30,"portslist":[]}(pgobject)', node_type='0', deleted='0', create_time='2024-10-30t15:17:27.666934', update_time='2024-11-04t16:28:17.300038600', create_user='10014', extend='{}(pgobject)', share='0' where id='1301203324149694464' invalid input syntax for type json LINE 1: ...d='1126536120784388096', process_source='1', node='{"x":612,... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: ...2,"y":12,"width":180,"height":30,"portslist":[]}(... update tb_process set name='产品b生产过程', process_type='lci_result', default_allocation_method='economic', quantitative_reference_id='1298209149091315712', location_id='1298207168243171329', process_doc_id='1298207168247365632', tags='产品', library='custom', product_system_id='1298206895525330944', process_source='1', node='{"x":812,"y":13.666666666666664,"width":180,"height":90,"virtual":false,"nodelock":true,"portslist":[{"y":40,"id":"1298209149091315712","group":"portlieright"},{"y":23.333333333333336,"id":"1298357883611643904","group":"portlieleft"},{"y":56.66666666666667,"id":"1298208944820322304","group":"portlieleft"}]}(pgobject)', node_type='0', deleted='0', create_time='2024-10-22t08:51:48.432861', update_time='2024-11-05t11:11:42.187271300', create_user='10014', extend='{}(pgobject)', share='0' where id='1298207168243171328' invalid input syntax for type json LINE 1: ...d='1298206895525330944', process_source='1', node='{"x":812,... ^ DETAIL: Token "(" is invalid. CONTEXT: JSON data, line 1: ...":"1298208944820322304","group":"portlieleft"}]}(... update tb_process set name='过程-1', process_type='lci_result', quantitative_reference_id='1257321276205174784', location_id='1257321014069563393', process_doc_id='1257321014090534912', tags='', library='custom', product_system_id='1257320991755866112', process_source='1', node_type='0', deleted='0', create_time='2024-07-01t13:04:49.788834', update_time='2024-11-05t13:53:45.050726900', create_user='10014', share='0' where id='1257321014069563392' no results to fetch select id,status,message,product_system_id,final_demand,method_id,method_name,description,nw_set_id,nw_set_name,calculate_type,monte_carlo_number,model_snapshot,create_user,create_time,update_time from tb_calculation_task where (product_system_id = '1298311160348545024') order by create_time desc limit '9999' column "description" does not exist LINE 1: ...duct_system_id,final_demand,method_id,method_name,descriptio... ^ select id,status,message,product_system_id,final_demand,method_id,method_name,description,nw_set_id,nw_set_name,calculate_type,monte_carlo_number,model_snapshot,create_user,create_time,update_time from tb_calculation_task where (id = '1298311273208877056') column "description" does not exist LINE 1: ...duct_system_id,final_demand,method_id,method_name,descriptio... ^ select id,status,message,product_system_id,final_demand,method_id,method_name,description,nw_set_id,nw_set_name,calculate_type,monte_carlo_number,model_snapshot,create_user,create_time,update_time from tb_calculation_task where (product_system_id = '1276473778162892800' and status = '0') column "description" does not exist LINE 1: ...duct_system_id,final_demand,method_id,method_name,descriptio... ^ select id,status,message,product_system_id,final_demand,method_id,method_name,description,nw_set_id,nw_set_name,calculate_type,monte_carlo_number,model_snapshot,create_user,create_time,update_time from tb_calculation_task where id='1298311273208877056' column "description" does not exist LINE 1: ...duct_system_id,final_demand,method_id,method_name,descriptio... ^ insert into tb_calculation_task ( id, status, product_system_id, final_demand, method_id, method_name, calculate_type, create_user ) values ( '1301153780011634688', '0', '1276473778162892800', '[{"processid":"1276522182217826304","processname":"【未知名称过程】","exchangeid":"1295414319390916608","flowid":"1295413954654240768","flowname":null,"flowpropertyid":"1972","flowpropertyname":null,"unitid":"1851","unitname":null,"amount":1.0}]', '44645931', 'ipcc 2013 gwp 100a', 'lci,lcia,contribution,sensitivity', '10078' ) no results to fetch update tb_calculation_task set status='2',message='execution.timeout' where (status = '0' and create_time < '2024-10-29t23:53:48.108204400') no results to fetch select id from tb_location_gis where id in ( '770' , '834' , '835' , '970' , '844' , '847' , '1255858870887124993' , '977' , '914' , '915' , '980' , '728' , '857' , '922' , '988' , '733' , '989' , '734' , '929' , '807' , '808' , '1000' , '745' , '873' , '880' , '818' , '950' , '823' , '831' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '770' , '834' ,... ^ select id from tb_location_gis where id in ( '1025' , '770' , '834' , '962' , '835' , '970' , '906' , '844' , '972' , '847' , '912' , '977' , '914' , '915' , '980' , '981' , '982' , '728' , '857' , '922' , '986' , '988' , '989' , '734' , '927' , '929' , '995' , '867' , '934' , '807' , '935' , '808' , '1000' , '744' , '873' , '809' , '939' , '750' , '880' , '818' , '1011' , '948' , '950' , '823' , '1018' , '827' , '831' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '1025' , '770' ... ^ select id from tb_location_gis where id in ( '929' , '835' , '934' , '808' , '1000' , '873' , '844' , '847' , '880' , '977' , '818' , '950' , '823' , '728' , '952' , '922' , '827' , '988' , '733' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '929' , '835' ,... ^ select id from tb_location_gis where id in ( '835' , '808' , '1000' , '873' , '847' , '880' , '818' , '728' , '952' , '922' , '827' , '988' , '733' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '835' , '808' ,... ^ select id from tb_location_gis where id in ( '834' , '835' , '934' , '808' , '1000' , '1032' , '873' , '970' , '939' , '847' , '880' , '977' , '818' , '980' , '950' , '823' , '728' , '952' , '922' , '986' , '827' , '988' , '989' , '733' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '834' , '835' ,... ^ select id from tb_location_gis where id in ( '929' , '834' , '835' , '934' , '808' , '1000' , '1032' , '873' , '844' , '847' , '880' , '977' , '818' , '948' , '950' , '823' , '728' , '952' , '922' , '827' , '988' , '733' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '929' , '834' ,... ^ select id from tb_location_gis where id in ( '835' , '808' , '1000' , '873' , '847' , '880' , '977' , '818' , '950' , '823' , '728' , '952' , '922' , '827' , '988' , '733' ) and st_within(st_setsrid(st_makepoint('120.34401518137248', '37.23081482267007'), 4326), boundary) relation "tb_location_gis" does not exist LINE 1: select id from tb_location_gis where id in ( '835' , '808' ,... ^ update tb_product_system set update_time='2024-10-30t09:12:45.468951800' where (id = '1298311160348545024') no results to fetch update tb_product_system set model_info = jsonb_concat(coalesce(model_info, '{}'::jsonb), '{"latitude":28.05251507633146,"longitude":120.88325500488283,"level":11,"zoomx6":1}'::jsonb) where id = '1247208720564224000' no results to fetch update tb_process_link set edge='null' where (source_node_id = '1298281444333846528' or target_node_id = '1298281444333846528' or source_process_id = '1298281444333846528' or target_process_id = '1298281444333846528') no results to fetch select id,username,password,real_name,nickname,id_number,avatar,gender,email,mobile,user_type,org_id,super_admin,person_auth_id,enterprise_auth_id,status,remark,open_id,last_login_time,valid_time,creator,create_time,updater,update_time,version,deleted from sys_user where deleted=0 column "valid_time" does not exist LINE 1: ...ise_auth_id,status,remark,open_id,last_login_time,valid_time... ^ select id,username,password,real_name,nickname,id_number,avatar,gender,email,mobile,user_type,org_id,super_admin,person_auth_id,enterprise_auth_id,status,remark,open_id,last_login_time,valid_time,creator,create_time,updater,update_time,version,deleted from sys_user where deleted=0 and (username = '18811520672') column "valid_time" does not exist LINE 1: ...ise_auth_id,status,remark,open_id,last_login_time,valid_time... ^ update tb_process_doc set time='data are mostly compiled from reports published between 2005 and 2010 but are considered representative of modern operations. ',technology='typical blast furnace process',geography='data are taken from blast furnace plants across europe and are considered representative of the average situation globally. ',valid_from='2005-01-01(localdate)',valid_until='2022-12-31(localdate)' where (id = '1300755604758855680') invalid input syntax for type date: "2005-01-01(localdate)" LINE 1: ...e of the average situation globally. ',valid_from='2005-01-0... ^ update tb_process_doc set intended_application='null',dataset_owner_id='null',data_generator_id='1219',data_documentor_id='1219',publication_id='1524',restrictions='null',project='null',creation_date='null',copyright='null' where (id = '1300755604758855680') invalid input syntax for type bigint: "null" LINE 1: ... set intended_application='null',dataset_owner_id='null',dat... ^ update tb_process_doc set inventory_method='null',modeling_constants='null',completeness='null',data_selection='null',data_treatment='see geography',sampling='data were taken from direct measurements at blast furnace plants across europe.',data_collection_period='null',reviewer_id='null',review_details='null' where (id = '1300755604758855680') invalid input syntax for type bigint: "null" LINE 1: ...urope.',data_collection_period='null',reviewer_id='null',rev... ^ delete from tb_process_doc d using tb_process p where p.process_doc_id = d.id and p.id = '1250455867959017472' no results to fetch insert into tb_process_doc ( id ) values ( '1303019285995589632' ) no results to fetch insert into tb_process_doc ( id, valid_from, valid_until, creation_date, copyright, data_documentor_id, data_generator_id, preceding_dataset ) values ( '1303019344908783616', '2011-01-01(localdate)', '2022-12-31(localdate)', '1900-11-20t09:59:32', '1', '1216', '1217', '1cdafdb1-4542-56ef-aec1-a12dd094e254' ) invalid input syntax for type date: "2011-01-01(localdate)" LINE 1: ...eceding_dataset ) values ( '1303019344908783616', '2011-01-0... ^ insert into tb_process_doc ( id, valid_from, valid_until, technology, data_treatment, sampling, copyright, data_documentor_id, data_generator_id, preceding_dataset ) values ( '1303019939065499648', '2014-01-01(localdate)', '2022-12-31(localdate)', 'cultivation of mulberry plant from conventional production standards', 'the data on inputs to the field activites are collected directly from the farmers and farming experts. however', 'the emission data were not readily available for india. hence', 'ecoinvent lci calculation tool for crop production was used to calculate field emissions from the cultivation process. ', 'focus group discussion', 'expert interviews', 'literature data and assumptions. the inventory dataset is based on data collected from farmer and silk worm rearer at guna district' ) invalid input syntax for type date: "2014-01-01(localdate)" LINE 1: ...eceding_dataset ) values ( '1303019939065499648', '2014-01-0... ^ insert into tb_process_doc ( id, valid_from, valid_until, data_treatment, sampling, creation_date, copyright, data_documentor_id, data_generator_id, publication_id, preceding_dataset ) values ( '1303035826132750336', '2004-01-01(localdate)', '2022-12-31(localdate)', 'model represents seawater reverse osmosis system with conventional pretreatment using enhance membrane modules and a single stage configuration and is used to represent actual tap water production using this technologie. ', 'this dataset is based on published literature and on modeling. ', '1900-01-20t15:39:08', '1', '1295', '1295', '1530', '16bcccc8-d034-555c-8162-fe36112a4150' ) invalid input syntax for type date: "2004-01-01(localdate)" LINE 1: ...eceding_dataset ) values ( '1303035826132750336', '2004-01-0... ^
In [15]:
s = "select id,username,password,real_name,nickname,id_number,avatar,gender,email,mobile,user_type,org_id,super_admin,person_auth_id,enterprise_auth_id,status,remark,open_id,last_login_time,valid_time,creator,create_time,updater,update_time,version,deleted from sys_user where deleted=0" res = execute_query(s)
column "valid_time" does not exist LINE 1: ...ise_auth_id,status,remark,open_id,last_login_time,valid_time... ^
In [ ]: