cx-oracle

Insert TIMESTAMP with milliseconds in Oracle with cx_Oracle and Python 3.6

烂漫一生 提交于 2021-02-19 17:47:53
问题 I need to insert a timestamp with milliseconds in an Oracle table with Python 3.6 and cx_Oracle 6.4.1. The insert is done okay but I am losing the milliseconds on the way. The timestamp is passed as a datetime object. Any ideas how I could keep the milliseconds without making a to_timestamp() in the SQL itself? I would like to keep passing a datetime in the SQL transaction. I use executemany() as the idea is to insert multiple records at once. import cx_Oracle import datetime conf = {

How to efficiently load mixed-type pandas DataFrame into an Oracle DB

删除回忆录丶 提交于 2021-02-10 18:18:18
问题 Happy new year everyone! I'm currently struggling with ETL performance issues as I'm trying to write larger Pandas DataFrames (1-2 mio rows, 150 columns) into an Oracle data base . Even for just 1000 rows, Panda's default to_sql() method runs well over 2 minutes (see code snippet below). My strong hypothesis is that these performance issues are in some way related to the underlying data types (mostly strings). I ran the same job on 1000 rows of random strings (benchmark: 3 min) and 1000 rows

How to install/use cx_Oracle in PyPy

一曲冷凌霜 提交于 2021-02-07 14:29:21
问题 I can't seem to find anything on Google or SO with information on getting cx_Oracle to work with PyPy. Can somebody please tell me if it's possible, and if so, how can I accomplish this? 回答1: PyPy actually has it's own cx_Oracle module, you need to compile it yourself though, which looks like: ./pypy/translator/goal/translate.py pypy/translator/goal/targetpypystandalone.py --withmod-oracle 回答2: After many hours spent on investigating different solutions, I sorted out that only this one is

How to install/use cx_Oracle in PyPy

旧巷老猫 提交于 2021-02-07 14:24:28
问题 I can't seem to find anything on Google or SO with information on getting cx_Oracle to work with PyPy. Can somebody please tell me if it's possible, and if so, how can I accomplish this? 回答1: PyPy actually has it's own cx_Oracle module, you need to compile it yourself though, which looks like: ./pypy/translator/goal/translate.py pypy/translator/goal/targetpypystandalone.py --withmod-oracle 回答2: After many hours spent on investigating different solutions, I sorted out that only this one is

Connect to DB using LDAP with python cx_Oracle

北战南征 提交于 2021-02-07 10:52:52
问题 I have a set of python scripts that use cx_Oracle to connect to a remote DB. This is a large project, were this connections are used several times. Additionally, I produce an .exe file that is distributed and should be as self-contained as possible. In other words, if I send you the .exe, you should be able to run it without any extra tinkering (I use pyinstaller ) Right now, I get a connection using ip = 'myhost.example.pt' port = 1521 SID = 'MYDB_PRD.EXAMPLE.PT' dsn_tns = cx_Oracle.makedsn

Connect to DB using LDAP with python cx_Oracle

二次信任 提交于 2021-02-07 10:52:43
问题 I have a set of python scripts that use cx_Oracle to connect to a remote DB. This is a large project, were this connections are used several times. Additionally, I produce an .exe file that is distributed and should be as self-contained as possible. In other words, if I send you the .exe, you should be able to run it without any extra tinkering (I use pyinstaller ) Right now, I get a connection using ip = 'myhost.example.pt' port = 1521 SID = 'MYDB_PRD.EXAMPLE.PT' dsn_tns = cx_Oracle.makedsn

SELECT data from another schema in oracle

ぐ巨炮叔叔 提交于 2021-02-04 17:08:05
问题 I want to execute a query that selects data from a different schema than the one specified in the DB connection (same Oracle server, same database, different schema) I have an python app talking to an Oracle server. It opens a connection to database (server/schema) A, and executes select queries to tables inside that database. I've tried the following : select .... from pct.pi_int, pct.pi_ma, pct.pi_es where ... But I get: ORA-00942: table or view does not exist I've also tried surrounding

SELECT data from another schema in oracle

心已入冬 提交于 2021-02-04 17:08:04
问题 I want to execute a query that selects data from a different schema than the one specified in the DB connection (same Oracle server, same database, different schema) I have an python app talking to an Oracle server. It opens a connection to database (server/schema) A, and executes select queries to tables inside that database. I've tried the following : select .... from pct.pi_int, pct.pi_ma, pct.pi_es where ... But I get: ORA-00942: table or view does not exist I've also tried surrounding

SELECT data from another schema in oracle

孤街醉人 提交于 2021-02-04 17:07:56
问题 I want to execute a query that selects data from a different schema than the one specified in the DB connection (same Oracle server, same database, different schema) I have an python app talking to an Oracle server. It opens a connection to database (server/schema) A, and executes select queries to tables inside that database. I've tried the following : select .... from pct.pi_int, pct.pi_ma, pct.pi_es where ... But I get: ORA-00942: table or view does not exist I've also tried surrounding

SELECT data from another schema in oracle

橙三吉。 提交于 2021-02-04 17:07:46
问题 I want to execute a query that selects data from a different schema than the one specified in the DB connection (same Oracle server, same database, different schema) I have an python app talking to an Oracle server. It opens a connection to database (server/schema) A, and executes select queries to tables inside that database. I've tried the following : select .... from pct.pi_int, pct.pi_ma, pct.pi_es where ... But I get: ORA-00942: table or view does not exist I've also tried surrounding