[Qt-interest] How to fetch primary key of database table?

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Sun Feb 1 06:36:15 CET 2009


Hi Christopher / Robert, 

There is also QSqlDatabase::primaryIndex. 

Regards, 

Tony.

> -----Original Message-----
> From: qt-interest-bounces at trolltech.com 
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of 
> Christopher Rasch-Olsen Raa
> Sent: Sunday, 1 February 2009 04:08
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] How to fetch primary key of database table?
> 
> 
> 
> 
> On Sat, 31 Jan 2009 17:54:02 +0100, Robert Hairgrove 
> <evorgriahr at hispeed.ch> wrote:
> > Unlike ODBC, there don't seem to be any built-in functions in the
> > QSql<...> objects for retrieving the names and columns of 
> primary key
> > constraints in database tables.
> 
> How about QSqlTableModel::primaryKey() ?
>  
> > If there are, it would be nice to know how to do this in a
> > DBMS-independent manner. Thanks!
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> --
> Christopher
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> __________ NOD32 3815 (20090131) Information __________
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> 
> 




More information about the Qt-interest-old mailing list