[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src/dbdrivers/cxoracle DBdriver.py
From: |
Jason Cater |
Subject: |
gnue/common/src/dbdrivers/cxoracle DBdriver.py |
Date: |
Thu, 17 Jan 2002 18:11:33 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/01/17 18:11:33
Modified files:
common/src/dbdrivers/cxoracle: DBdriver.py
Log message:
added enhanced intro support
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/cxoracle/DBdriver.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gnue/common/src/dbdrivers/cxoracle/DBdriver.py
diff -c gnue/common/src/dbdrivers/cxoracle/DBdriver.py:1.6
gnue/common/src/dbdrivers/cxoracle/DBdriver.py:1.7
*** gnue/common/src/dbdrivers/cxoracle/DBdriver.py:1.6 Thu Jan 10 15:59:18 2002
--- gnue/common/src/dbdrivers/cxoracle/DBdriver.py Thu Jan 17 18:11:33 2002
***************
*** 32,41 ****
# service= This is the Oracle TNS name for your connection (required)
#
- #### THIS IS AN UNTESTED DRIVER ####
- #### Any volunteers? ####
-
-
from string import lower
import sys
from gnue.common import GDebug, GDataObjects, GConnections
--- 32,37 ----
***************
*** 91,97 ****
# Return a list of the types of Schema objects this driver provides
def getSchemaTypes(self):
return [ ('user_table', 'User Table',1),
! ('user_view', 'User View',1),
('user_synonym', 'User Synonym',1),
('all_table', 'System Table',1),
('all_view', 'System View',1),
--- 87,93 ----
# Return a list of the types of Schema objects this driver provides
def getSchemaTypes(self):
return [ ('user_table', 'User Table',1),
! ('user_view', 'User View',1),
('user_synonym', 'User Synonym',1),
('all_table', 'System Table',1),
('all_view', 'System View',1),
***************
*** 101,114 ****
def getSchemaList(self, type=None):
where_user = ""
! if type == None:
where_type = ['TABLE', 'VIEW', 'SYNONYM']
! else:
scope, type = string.split(type,'_')
where_type = [string.upper(type)]
! if scope == 'user':
where_user = " AND OWNER = USER"
!
statement = \
"select owner||'.'||table_name||'.'||table_type full_name, " + \
--- 97,110 ----
def getSchemaList(self, type=None):
where_user = ""
! if type == None:
where_type = ['TABLE', 'VIEW', 'SYNONYM']
! else:
scope, type = string.split(type,'_')
where_type = [string.upper(type)]
! if scope == 'user':
where_user = " AND OWNER = USER"
!
statement = \
"select owner||'.'||table_name||'.'||table_type full_name, " + \
***************
*** 135,141 ****
# Find a schema object with specified name
def getSchemaByName(self, name, type=None):
! return None
# Get fields for a table
--- 131,163 ----
# Find a schema object with specified name
def getSchemaByName(self, name, type=None):
!
! spl = string.split(string.upper(name),'.')
! where = "TABLE_NAME='%s" % spl[-1]
! if len(spl) > 1:
! where += " AND OWNER=%s" % spl[-2]
!
! statement = \
! "select owner||'.'||table_name||'.'||table_type full_name, " + \
! "decode(owner,user,null,owner||'.')||table_name table_name, " + \
! "decode(owner,user,'user_','all_')||lower(table_type) table_type " + \
! "from all_catalog where %s " \
! % (where) + \
! "order by table_name "
!
! GDebug.printMesg(5,statement)
!
! cursor = self._dataConnection.cursor()
! cursor.execute(statement)
!
! list = []
! rs = cursor.fetchone()
! rv = GDataObjects.Schema(attrs={'id':string.lower(rs[0]), 'name':rs[1],
! 'type':rs[2]},
! getChildSchema=self.__getFieldSchema)
!
! cursor.close()
! return rv
# Get fields for a table
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/common/src/dbdrivers/cxoracle DBdriver.py,
Jason Cater <=