[Work] python read the memo written oracle csv problems encountered

One problem: pl / sql query tool export issues

   Common sense with pl / sql query tool, export, particularly slow, more than ten million data, the amount of data exceeds 1G, is expected to take several hours, they appear too long on the main pl / sql page.

 Sometimes the error "the result set exceeds the maximum length 100mb", through plsql settings: TOOLS-- PREFERENCES-WINDOW TYPES -SQL WINDOW - MAXIMUM RESULT SET SIZE to resolve.

Question two: export into python, met Chinese character set issues

 提示:UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence

The last method used, do not know where to work

 (1)

= Open WriteFile ( 'teacher.txt', 'W', encoding = 'UTF-. 8')   
# database character set is UTF8
(2)
Create Table lxgtmp AS SELECT t1.xm, t1.shenfenzheng, t2.telephone from T1 tb_biz_jzgjbxx , tb_biz_jzglxfs T2 the WHERE ....
# does not rule out the middle character set has changed, re-establishment of the data. If the temporary table is not set, the intermediate discharge process, export to more than 900 jam error.
(3) setting the character set level os
python derived code, add the following code
import os
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'

Character set, here in this talk is also very good

https://blog.csdn.net/melon0014/article/details/52452906

 

More than four issues python file called each other questions

 

Guess you like

Origin www.cnblogs.com/lxgbky/p/12376127.html