Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 552171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:28:16+00:00 2026-05-13T11:28:16+00:00

Well, I hope this is not a duplicate, the search did not yield anything

  • 0

Well, I hope this is not a duplicate, the search did not yield anything useful.

I have been toying with cx_Oracle for the past few days, installing and using it. Everything went fine until I reached my current problem: I’d like to change my schema. If I were using sqlplus a simple ‘alter session set current_schema=toto;’ would do, but I don’t know how to get around it with cx_Oracle.

I’ve downloaded the latest source version: cx_Oracle-5.0.2.tar.gz.

According to the documentation changing of schema is a simple case of setting Connection.current_schema which should be a read-write attribute… the trouble is my Connection object does not have any current_schema attribute.

>>> c = cx_Oracle.connect(...)
>>> dir(c)
['__class__', '__delattr__', '__doc__', '__enter__', '__exit__', '__format__', 
'__getattribute__', '__hash__', '__init__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', 
'__subclasshook__', 'autocommit', 'begin', 'cancel', 'changepassword', 'close', 
'commit', 'cursor', 'dsn', 'encoding', 'inputtypehandler',
'maxBytesPerCharacter', 'nencoding', 'outputtypehandler', 'password', 'prepare', 
'register', 'rollback', 'stmtcachesize', 'tnsentry', 'unregister', 'username', 
'version']

Trying to set the attribute using

>>> c.current_schema = 'toto'

results in an error… __setattr__ has apparently been overridden to prevent it.

So… does anyone know how to ?


Here is the error I got.

>>> c.current_schema = 'toto'
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
AttributeError: 'cx_Oracle.Connection' object has no attribute 'current_schema'

>>> setattr(c, 'current_schema', 'toto')
# same error

And here are the information about OS and python:

SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 3

And I use python 2.6.2 (compiled for 64bits)

I also compiled cx_Oracle for 64bits, on the very same machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:28:17+00:00Added an answer on May 13, 2026 at 11:28 am

    Okay, I finally, after much trying and error, followed fn suggestion and investigated inside cx_Oracle to find what was wrong.

    It turns out that a number of arguments and methods are only available through some flags:

    • WITH_UNICODE activates encoding and nencoding attributes
    • ORACLE_10G activates action, module, clientinfo and current_schema

    I checked and found out that I had compiled cx_Oracle against the version 9 of the oracle client… so I recompiled against the version 10.2.0.3 of the oracle client and now I have access to these attributes.

    Shame that the restriction was not precised in the documentation… and I am very thankful that the source code is available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't find a duplicate for this question, but I honestly hope I'm not
I hope this question isn't too general. Well, the situation is that I am
I hope I can explain this well enough so that you can understand the
hope all is well. I am using Version 7.0. This morning I was struggling
This case is a bit complex, I hope I will simplify it well. My
Well, I have a simple question, at least I hope its simple. I was
Well, my website can not redirect to https://www.facebook.com/QuaFootSpa from http://quafootspa.com/ I have tried redirection
well i have a configuration like this in the components part of my config
This phone have something very useful. That is his option to schedule power on
I hope that this one is not going to be ask-and-answer question... here goes:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.