Category : oracle

i have some problems to connect to a database via python I have an excel file witch can connect to this database, but i dont know how to do that with python Here the connection string from the excel file: DSN=BAAN;UID=baanread;PWD=baanread;DBQ=BAANIV;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;MLD=0;ODA=F; How can I change the string below to connect to python via pyodbc? cnxn ..

Read more

How to execute Oracle Materialize view using sqlalchemy ? ur expertise is needed 🙂 mview = ‘mv_test’ mview_refresh_sql = f"EXEC DBMS_MVIEW.REFRESH(‘{mview}’, method => ‘?’)" try: conn.execute(mview_refresh_sql) Exception as err: print({err}) It is throwing error: Error in refreshing MVIEW mv_covid19_jhu_trend : ORA-00900: invalid SQL statement Source: Python..

Read more

I updagrade to oracle 21 and I need an rpm cx_oracle compatible oracle 21 for my script python. ps: I can’t use python -m pip install cx_Oracle –upgrade –user if you have another rpm instead of rpm cx_oracle to connect to db it will be usefull also Thanks. Source: Python..

Read more

I am getting the following error. cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "dlopen(libclntsh.dylib, 1): image not found". One fix that I found was to insert cx_Oracle.init_oracle_client(lib_dir=path) which lead to a Oracle Client Library has already been initialized Error. However I do not call init_oracle_client anywhere in the code. I am using Python ..

Read more

I am using cx_Oracle in python to update a timestamp field in Apex table. Here is what I have done sql1 = (‘SELECT * from ab.TEMPTABLE’); sql2 = (‘UPDATE AB.CTIMEUPDATED SET TSTAMP = SYSTIMESTAMP’) try: connection=self.get_connection() with connection.cursor() as cursor: cursor.execute(sql2) cursor.execute(sql1) This doesn’t updates the value in CTIMEUPDATED table , however if I run ..

Read more

In my dataframe, I’ve a column called ‘DateStamp’ which shows today date as 2021-09-10 00:19:57.593350 final_df[‘DateStamp’] = pd.to_datetime(‘today’) However, when I export the dataframe to my Oracle Database, the DateStamp column is created with DATA_TYPE as DATE instead of timestamp dtyp2 = {c:types.VARCHAR(final_df_toDB[c].str.len().max()) …: for c in final_df_toDB.columns[final_df_toDB.dtypes == ‘object’].tolist()} final_df_toDB.to_sql(‘sample_table’,engine_conn, if_exists=’append’, index=False, dtype=dtyp2) and ..

Read more

I have a problem during loading strings using python string to Oracle database. Everything is fine until string doesn’t contain apostrophe ‘ If there is an apostrophe, string structure looks like this: [[‘exapmle’, ‘exapmle’, ‘exapmle’] [ "exapm’le", ‘exapmle’, ‘exapmle’]] while I want somehow to have this (double apostrophe is escape character for Oracle): [[‘exapmle’, ‘exapmle’, ..

Read more