Good day.

There is a need to choose a database schema when connecting (or when selecting data) to an Oracle database. But where in the connection parameters to specify it, I did not find. I would be happy for any help in this matter.

The manual is written to use the following parameters:

cx_Oracle.connect([user, password, dsn, mode, handle, pool, threaded, twophase, events, cclass, purity, newpassword]) 

Actually, everything is clear with the first three, but with the rest ... In general, I ask for your help.

PS Python programming language , cx_Oracle module.

Thank.

PPS It would be nice if the admins added the tag "cx_Oracle" =)


Very interesting addition! The following is written in the Connection Object :

 Connection.current_schema This read-write attribute sets the current schema attribute for the session. Note This attribute is an extension to the DB API definition. 

Those. It is possible to set read / write parameters for the current database schema. But how to choose it?

    2 answers 2

    You can install the scheme by doing the following:

     c = cx_Oracle.Connection('login', 'password', 'name db') c.current_schema = 'name schema' 

    More in detail here .

      I think you translated it wrong. "This readable and writable attribute identifies the current schema for the session." Those. after opening a connection, you can read it, recognizing the current circuit, and write it down, setting the current circuit.