#1097: Query to retrieve primary key in dbFirebird.getFields()
-------------------------+--------------------------------------------------
Reporter: uwe_grauer | Owner: somebody
Type: enhancement | Status: new
Priority: minor | Milestone: 0.8.2
Component: db | Version:
Keywords: |
-------------------------+--------------------------------------------------
I noticed that the query for the retrieve of the primary key field in
dbFirebird.getFields() is non optimal.
Change it to:
{{{
sql = """ SELECT b.RDB$FIELD_NAME, d.RDB$TYPE_NAME,
c.RDB$FIELD_LENGTH, c.RDB$FIELD_SCALE, b.RDB$FIELD_ID
FROM RDB$RELATIONS a
INNER JOIN RDB$RELATION_FIELDS b
ON a.RDB$RELATION_NAME = b.RDB$RELATION_NAME
INNER JOIN RDB$FIELDS c
ON b.RDB$FIELD_SOURCE = c.RDB$FIELD_NAME
INNER JOIN RDB$TYPES d
ON c.RDB$FIELD_TYPE = d.RDB$TYPE
WHERE a.RDB$SYSTEM_FLAG = 0
AND d.RDB$FIELD_NAME = 'RDB$FIELD_TYPE'
AND a.RDB$RELATION_NAME = '%s'
ORDER BY b.RDB$FIELD_ID """ % tableName.upper()
}}}
--
Ticket URL: <http://svn.dabodev.com/trac/dabo/ticket/1097>
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]