Results 1 to 7 of 7

Thread: QSqlField discovery auto_increment int value

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSqlField discovery auto_increment int value

    How is the code you posted above related to the problem?

    Did you check that the query is valid using QSqlQuery::isValid()?

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSqlField discovery auto_increment int value

    Quote Originally Posted by wysota View Post
    How is the code you posted above related to the problem?

    Did you check that the query is valid using QSqlQuery::isValid()?

    QSqlQuery::isValid() is valid true
    QSqlRecord::requiredStatus() is true
    only QSqlRecord::isAutoValue() is every time false on all field auto_increment mysql or index from sqlite.... http://doc.trolltech.com/4.2/demos-s...owser-cpp.html

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSqlField discovery auto_increment int value

    What happens if you pass NULL as a value to that field? Does the database generate a correct record for it? I think isAutoValue() will return true only if you first use QSqlField::setAutoValue().

  4. #4
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSqlField discovery auto_increment int value

    Quote Originally Posted by wysota View Post
    What happens if you pass NULL as a value to that field? Does the database generate a correct record for it? I think isAutoValue() will return true only if you first use QSqlField::setAutoValue().
    i need only to discover a clean shema from odbc driver mysql , access , sqlite ... ecc

    if table is so.....

    Qt Code:
    1. CREATE TABLE `BASE_0` (
    2. `ID` int(22) NOT NULL auto_increment,
    3. `LANGUAGE` varchar(100) default NULL,
    4. `PREFIX` varchar(55) default NULL,
    5. `TITLE` varchar(150) default NULL,
    6. `NAME` varchar(100) default NULL,
    7. `FIRST_NAME` varchar(110) default NULL,
    8. PRIMARY KEY (`ID`)
    9. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    To copy to clipboard, switch view to plain text mode 

    i like to discover field "ID auto_increment" but i think is impossibel to make a clean dump from table .... driver mysql give a different result shema as odbc...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.