#1097: Query to retrieve primary key in dbFirebird.getFields()
--------------------------+-------------------------------------------------
  Reporter:  uwe_grauer   |       Owner:  uwe_grauer
      Type:  enhancement  |      Status:  assigned  
  Priority:  minor        |   Milestone:  0.8.2     
 Component:  db           |     Version:            
Resolution:               |    Keywords:            
--------------------------+-------------------------------------------------
Comment (by uwe_grauer):

 I copied the wrong query before!

 This is the right one:
 {{{
                 # The following does the right thing
                 sql = """ SELECT S.RDB$FIELD_NAME AS COLUMN_NAME
                 FROM RDB$RELATION_CONSTRAINTS RC
                 LEFT JOIN RDB$INDICES I ON
                 (I.RDB$INDEX_NAME = RC.RDB$INDEX_NAME)
                 LEFT JOIN RDB$INDEX_SEGMENTS S ON
                 (S.RDB$INDEX_NAME = I.RDB$INDEX_NAME)
                 WHERE (RC.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY')
                 AND (I.RDB$RELATION_NAME = '%s') """ % tableName.upper()

 }}}

-- 
Ticket URL: <http://svn.dabodev.com/trac/dabo/ticket/1097#comment:3>
Dabo <http://svn.dabodev.com/trac/dabo>
Trac Page for Dabo


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to