Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124575

Firebird 5 empty result with decimal value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 FF
    • 5.15.15, 6.0
    • SQL Support
    • None
    • Windows
    • 373ae6cbd (dev)

    Description

      Dear 

      with driver Firebird 5 and NUMERIC fields we have empty query with fields with height digits .

      The table product1 has field price with 20 digits with 4 decimal places

       

      CREATE TABLE product1 (    
      id INT PRIMARY KEY,    
      price NUMERIC(20,4) -- Example: 20 digits with 4 decimal places);
      );
      INSERT INTO product1(id,price) values(1,40001.1234);
      INSERT INTO product1(id,price) values(2,40001.1234);
      INSERT INTO product1(id,price) values(3,40001.1234);
      SELECT sum(price) FROM product1;
      SELECT price FROM product1;
          QCoreApplication a(argc, argv);
          // Establishing connection to the Firebird database
          auto dir = QCoreApplication::applicationDirPath();
          QSqlDatabase db = QSqlDatabase::addDatabase("QIBASE");
          db.setHostName("localhost"); // Replace with your Firebird server hostname
          db.setDatabaseName(QStringLiteral("%1/../database.fdb").arg(dir)); 
          db.setUserName("SYSDBA"); // Replace with your username
          db.setPassword("firebird"); // Replace with your password   
       if (!db.open()) {
              qDebug() << "Error: Failed to connect to database:" << db.lastError().text();
              return -1;
          } else {
              qDebug() << "Connected to database!";
          }
          QSqlQuery query("SELECT price FROM product1",db);
          while (query.next()) {
              qDebug() << query.value(0);
          }    // Perform your database operations here    // Closing the database connection
          db.close(); 

      The  query does not return values instead with few digits we have the result

       

      CREATE TABLE product2 (    
      id INT PRIMARY KEY,    
      price NUMERIC(10,4) -- Example: 10 digits with 4 decimal places
      );
      
      INSERT INTO product2(id,price) values(1,4001.1234);
      INSERT INTO product2(id,price) values(2,4001.1234);
      INSERT INTO product2(id,price) values(3,4001.1234);
      
       

       

      Attached you find the database.

       

      Attachments

        1. database.fdb
          3.39 MB
          Pier V
        For Gerrit Dashboard: QTBUG-124575
        # Subject Branch Project Status CR V

        Activity

          People

            chehrlic Christian Ehrlicher
            pier77 Pier V
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes