标签:dataframe port import ora 安装 连接 write oracl 百度搜
pip install cx_Oracle
下载地址:百度搜索下载,Oracle PLSQL 进行下载
# coding:utf-8 import pandas as pd import sys import codecs #sys.stdout = codecs.getwriter("gbk")(sys.stdout.detach()) from sqlalchemy import create_engine import cx_Oracle #db=cx_Oracle.connect(‘admin‘,‘admin‘,‘172.16.1.452:1521/orcl‘,encoding = "UTF-8", nencoding = "UTF-8") db=cx_Oracle.connect(‘你的账号‘,‘密码‘,‘IP:端口/服务名‘,encoding = "UTF-8", nencoding = "UTF-8") print (db.version) cr=db.cursor() SQL2 = ‘‘‘SELECT * FROM OA_W_BAOXIAOMXYWB‘‘‘ cr.execute(SQL1) rs=cr.fetchall() zz=pd.DataFrame(rs) print (zz) db.close()
标签:dataframe port import ora 安装 连接 write oracl 百度搜
原文地址:https://www.cnblogs.com/wuzaipei/p/11594243.html