Results 1 to 14 of 14

Thread: submitAll() -> "no fields to update"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    849
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 163 Times in 151 Posts

    Default Re: submitAll() -> "no fields to update"

    I get the error on Oracle + linux.

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

    Default Re: submitAll() -> "no fields to update"

    Quote Originally Posted by caduel View Post
    I get the error on Oracle + linux.
    debug your table if driver can find index field from table
    If no index is found it not possibel to "auto update" or submitAll().

    Mysql = SHOW INDEX FROM table
    Ora = select index_name from dba_indexes where table_name='tablename';
    on oracle must display a key PRIMARY
    if not, set one...

    update where what = xx


    Qt Code:
    1. /* discovery total row whitout limit mysql / to play next prev ... button */
    2. void Mysql_Table::UpdateSumm()
    3. {
    4. QString grepprimary,grepauto;
    5. /* reset index fieldname */
    6. /* SHOW INDEX FROM table */
    7.  
    8. INDEXFIELD = "";
    9. FieldNameList.clear();
    10. const QString info = QString("SHOW COLUMNS FROM %1").arg(table);
    11. QSqlQuery query(info,db);
    12. QSqlRecord rec = query.record();
    13. ////int sumcol = rec.count();
    14. while (query.next()) {
    15. grepprimary = query.value(3).toString();
    16. grepprimary = grepprimary.toLower();
    17. grepauto = query.value(5).toString();
    18. grepauto = grepauto.toLower();
    19. ///////Q_ASSERT(grepauto.size() > 1); /* no mysql or not connect! or grand not...*/
    20. if (grepprimary == "pri" && grepauto.contains("auto")) {
    21. INDEXFIELD = query.value(0).toString();
    22. //////////qDebug() << "### INDEXFIELD have found " << INDEXFIELD ;
    23. }
    24. FieldNameList.append(query.value(0).toString());
    25. }
    26.  
    27.  
    28. if (INDEXFIELD.size() < 1) {
    29. haveindex = false;
    30. } else {
    31. haveindex = true;
    32. }
    33.  
    34.  
    35. totalrow = 0;
    36. if (haveindex) {
    37. const QString summitem = QString("SELECT COUNT(%2) FROM %1").arg(table).arg(INDEXFIELD);
    38. query.exec(summitem);
    39. while (query.next()) {
    40. totalrow = query.value(0).toInt();
    41. }
    42.  
    43. }
    44. qDebug() << "### totalrow " << totalrow;
    45.  
    46. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Nov 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: submitAll() -> "no fields to update"

    I get the error on postgresql + linux.

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.