cx_oracle错误未显示整个databaseError

时间:2019-09-25 17:43:26

标签: python-3.x oracle plsql cx-oracle

当我尝试使用try并且除了在cx_Oracle中捕获databaseError时,失败的引用没有在终端中显示整个Error消息。但是,当我在Visual Studio代码交互式窗口中运行python时,它会显示。代码是一样的。有人可以帮我吗?

            p_cur = cx_Oracle.cusor()
            try:
                p_cur.callproc('dwh_analytical_reporting.ent_rpt_unit_test_support.check_ut_result',
                    [p_schema_nm, p_tbl_nm, p_rpt_nm, p_ut_type, p_db_cnn, p_status])
            except cx_Oracle.DatabaseError as e:
                error, = e.args
                print(error.message)
                raise

在终端中,结果如下:

```
3 - no current data found tbl_aff_noscan_final as of 25-sep-2019
ORA-06512: at "DWH_ANALYTICAL_REPORTING.ENT_RPT_UNIT_TEST_SUPPORT", line 1191
ORA-06512: at line 1
Traceback (most recent call last):
  File "process_utf-aff-checklist-aff-scanned-post.py", line 196, in <module>
    func_parsing(data_post, p_cur)
  File "process_utf-aff-checklist-aff-scanned-post.py", line 136, in func_parsing
    stage['rpt-name'], stage['ut-type'], stage['db-cnn'])
  File "process_utf-aff-checklist-aff-scanned-post.py", line 42, in ut_result
    [p_schema_nm, p_tbl_nm, p_rpt_nm, p_ut_type, p_db_cnn, p_status])
3 - no current data found tbl_aff_noscan_final as of 25-sep-2019d post unit test failed
ORA-06512: at "DWH_ANALYTICAL_REPORTING.ENT_RPT_UNIT_TEST_SUPPORT", line 1191
ORA-06512: at line 1
```

在vs代码交互窗口中,结果如下:

```
DatabaseError: ORA-20001: utf-aff-checklist-aff-scanned post unit test failed 
1 - duplicate records found tbl_aff_noscan_001
2 - duplicate records found tbl_aff_noscan_final
3 - no current data found tbl_aff_noscan_final as of 25-sep-2019
ORA-06512: at "DWH_ANALYTICAL_REPORTING.ENT_RPT_UNIT_TEST_SUPPORT", line 1191
ORA-06512: at line 1
```

终端版本缺少两个错误结果。

0 个答案:

没有答案