Skip to main content

All Questions

0 votes
1 answer
21 views

Call oracledb Connection.gettype from SQLAlchemy.AssyncSession

Have an async connection pool in FastApi application. Using python-oracledb async connection pool (thin mode). Trying to call Connection.gettype(name) (await (await session.connection())....
Kamo Petrosyan's user avatar
1 vote
1 answer
50 views

python-oracledb how to change arraysize for session

Stack: oracledb==2.5.1 sqlalchemy==2.0.25 fastapi==0.105.0 How can I change Cursor's arraysize for a session? I Know how to set arraysize on createengine and it works for all connections in the pool ...
Kamo Petrosyan's user avatar
0 votes
0 answers
38 views

Pandas - decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>] during read_sql

I am running an extraction of a table in Python using Pandas. I am getting this error: decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>] The code: dataframes[table] = pd.read_sql(...
mrlelis's user avatar
2 votes
1 answer
1k views

Python using oracledb to connect to Oracle database with Pandas DataFrame Error: "pandas only supports SQLAlchemy connectable (engine/connection)"

I am pretty new to Python and even newer to Pandas and am hoping for some guidance My company has an on-prem DEV Oracle database that I am trying to connect to using Python & Pandas. After some ...
chilly8063's user avatar
0 votes
1 answer
843 views

Python-oracledb: DPY-6005: cannot connect to database (CONNECTION_ID=""). DPY-3008: unsupported in-band notification with error number 12572

I'm trying to connect to an Oracle database in Python using SQLAlchemy together with OracleDB. But I always get this error: sqlalchemy.exc.OperationalError: (oracledb.exceptions.OperationalError) DPY-...
mrlelis's user avatar
0 votes
2 answers
197 views

Pandas read_sql with SQLAlchemy from Oracle Database with many parameters

I have a working setup to read sql data into a pandas dataframe: connect_string = f"DSN={config.DB};UID={credentials['UID']};PWD={credentials['pwd']};DBQ={config.DB_server};DBA=W;APA=T;EXC=F;FEN=...
Fred's user avatar
  • 593
0 votes
1 answer
169 views

select from DUAL python sqlalchemy ORM

I have a custom function on oracle database called create_identifier. It acccept a string and a column and concatenate the abbreviated form of the string to the column. I am trying to get the python ...
Isaac's user avatar
  • 25
0 votes
1 answer
717 views

connecting python to Oracle using sqlalchemy and oracledb

Need to connect to Oracle using Python that uses SQLAlchemy. I need to use the oracledb package. Using code from Github import os import oracledb from sqlalchemy import create_engine from sqlalchemy ...
nate brown's user avatar
0 votes
2 answers
227 views

SQL Alchemy 2.0 reflecting Oracle table

I was trying to find but wihtout luck whether this question had been asked for SQL Alchemy 2.0+ as all I could find were older versions. I'm connecting fine to Oracle and can query just by executing ...
Jaehaerys68's user avatar
2 votes
2 answers
175 views

How to force Sqlalchemy to point to a schema different from the default schema for a connection string

I have an oracle database connection with just a read access. When I connect to the database using collection string engine = create_engine(f"oracle+oracledb://{DB_USER}:{DB_PASSWORD}@{DB_URL{...
Isaac's user avatar
  • 25
0 votes
1 answer
246 views

How can I select * from table, but cast one or more of the columns to a different datatype using ORM (Sqlalchemy)

I have this multiple orm model for fastapi endpoint like this: @mapper_registry.mapped @dataclass class Department: __tablename__ = "department" __sa_dataclass_metadata_key__ = &...
Isaac's user avatar
  • 25
1 vote
1 answer
365 views

SQLAlchemy + oracledb/cx_Oracle Insert truncates Timestamp to seconds

I need to merge dataframe which contains data in usual "pandas._libs.tslibs.timestamps.Timestamp" type. This df has the following structure my_test_date = pd.to_datetime(1674009901958454, ...
Faenno's user avatar
  • 39
0 votes
0 answers
287 views

OracleDB Fetch from Select when handling output CLOB Type cause Python crash

I have been using SQLAlchemy with OracleDB as driver to build my applications. I observed one of the process being killed unexpectedly while being inside a try except Exception block. And after trial ...
Tuan's user avatar
  • 21
0 votes
1 answer
273 views

Python : How to handle case-sensitive and double-quoted postgres column name?

I have python script for incremental data processing. The data source come from Oracle 32-bit and target table is Postgres like below : import pandas as pd import cx_Oracle import psycopg2 import os ...
Afif Pratama's user avatar
0 votes
1 answer
2k views

DPY-4011: the database or network closed connection

I use flask 2.2.2, gunicorn 20.1.0, sqlalchemy 2.0.13 without Flask-SQLAlchemy and oracledb 1.3.1. I have two scemas and two engines each for their own schema because they need different users to ...
Артем Котов's user avatar

15 30 50 per page