0

I need to upload a table I modified to my oracle database. I exported the table as pandas dataframe modified it and now want to upload it to the DB.

I am trying to do this using the df.to_sql function as follows:

import sqlalchemy as sa
import pandas as pd
engine = sa.create_engine('oracle://"IP_address_of_server"/"serviceDB"')

df.to_sql("table_name",engine, if_exists='replace', chunksize = None)

I always get this error: DatabaseError: (cx_Oracle.DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (Background on this error at: http://sqlalche.me/e/4xp6).

I am not an expert of this, so I could not understand what the matter is, specially that the IP_address I am givingg is the right one.

Could anywone help? Thanks a lot!

Ben Jo
  • 71
  • 1
  • 15
  • Maybe this helps: [ora-12505-tnslistener-does-not-currently-know-of-sid-given-in-connect-descript](https://stackoverflow.com/questions/18192521/ora-12505-tnslistener-does-not-currently-know-of-sid-given-in-connect-descript). – Mayank Porwal Jan 30 '19 at 07:35
  • unfortunately no. I am entering my connection parameters like this: `sa.create_engine('oracle://11.xxx.xxx.xxx.xxx/service_name')` where the x are numbers of course. – Ben Jo Jan 30 '19 at 07:41
  • Well, unless I'm wrong, try with `host:port/service_name`, e.g. `123.664.23.12:1521/ORCL`. It seems that you either didn't provide port number, or - if you did - you didn't separate it from host's IP address with a colon `:`. – Littlefoot Jan 30 '19 at 07:56
  • Hey @Littlefoot I tried to add the port number as you told me, this hasn't change anything. I still gett the `DatabaseError` – Ben Jo Feb 01 '19 at 05:10
  • That's a pity. Hopefully, someone else will be able to assist. – Littlefoot Feb 01 '19 at 06:09

0 Answers0