/[gnue]/gnue-common/src/datasources/drivers/interbase/interbase/Driver.py
ViewVC logotype

Diff of /gnue-common/src/datasources/drivers/interbase/interbase/Driver.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by btami, Fri Aug 8 18:29:20 2003 UTC revision 1.22 by btami, Thu Sep 11 21:03:19 2003 UTC
# Line 35  Line 35 
35    
36    
37    
38  from string import lower, rstrip  from string import upper, lower, rstrip
39  import sys  import sys
40  from gnue.common.datasources import GDataObjects, GConditions  from gnue.common.datasources import GDataObjects, GConditions
41  from gnue.common.apps import GDebug  from gnue.common.apps import GDebug
# Line 226  class Interbase_DataObject(DBSIG_DataObj Line 226  class Interbase_DataObject(DBSIG_DataObj
226        if nativetype in ('int','float','long'):        if nativetype in ('int','float','long'):
227          attrs['datatype']='number'          attrs['datatype']='number'
228          attrs['precision']=d[SIG2api.DESCRIPTION_SCALE]          attrs['precision']=d[SIG2api.DESCRIPTION_SCALE]
229        elif nativetype == 'datetime':        elif nativetype == 'tuple':
230          attrs['datatype']='date'          attrs['datatype']='date'
231        else:        else:
232          attrs['datatype']='text'          attrs['datatype']='text'
233    
234          cursor.execute("select rdb$default_source from rdb$relation_fields"+ \
235                      " where rdb$relation_name = '%s' " % (parent.name)+ \
236                      " and rdb$field_name = '%s'" % (upper(attrs['name'])))
237          defrs = cursor.fetchone()
238          if defrs[0]:
239            dflt = defrs[0]
240            if dflt[9:12] == "NOW":
241              attrs['defaulttype'] = 'timestamp'
242            else:
243              attrs['defaulttype'] = 'constant'
244              attrs['defaultval'] = dflt[8:]
245    
246        list.append(GDataObjects.Schema(attrs=attrs))        list.append(GDataObjects.Schema(attrs=attrs))
247    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26