글쎄, 이것이 중복되지 않았 으면 좋겠어.cx_Oracle을 사용하여 스키마 변경
저는 지난 며칠 동안 cx_Oracle
을 가지고 설치하고 사용하고 있습니다. 현재 문제가 발생할 때까지 모든 것이 잘되었습니다. 스키마를 변경하고 싶습니다. sqlplus를 사용하는 경우 간단한 '세션 변경 설정 current_schema = toto;' 그래도 그럴 수는 있지만 주위를 둘러 보는 법은 cx_Oracle
으로 알지 못합니다.
최신 소스 버전 인 cx_Oracle-5.0.2.tar.gz를 다운로드했습니다. 스키마의 documentation 변화에 따라
읽기 - 쓰기 속성이어야한다Connection.current_schema
를 설정하는 간단한 경우입니다 ... 문제는 내
Connection
객체가 어떤
current_schema
속성이없는 것입니다. 오류가
>>> c.current_schema = 'toto'
결과를 사용하여 속성을 설정하려고
>>> 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']
... __setattr__
은 분명히을 방지하기 위해 무시되었습니다.
그래서 ... 어떻게 알 수 있습니까?
여기 오류가 있습니다.
>>> 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
그리고 여기가 OS와 파이썬에 대한 정보입니다
SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 3
그리고 나는 또한 매우에, 64bit를위한 cx_Oracle
를 컴파일
(64bit를 컴파일) 파이썬 2.6.2를 사용 같은 기계.
눈에 보이는 속성으로 존재하지 않는다고해서 그다지 의미가 없습니다. '__setattr__'은 약간의 신비한 방식으로 그것을 구현하기 위해 무시 될 수 있습니다. 'dir (c) '보다 더 중요한 것은 실제로'c.current_schema ='toto '를 할 때 실제로 발생한 오류입니다. –