Number(20) cannot be read!

Number(20) cannot be read!

Hi,

using c++ builder 10.3.2, unidac 9.2.1.
I have an oracle table with column number (20) populated with numbers having 17 digits

  1. create table pelidetail(id number(9), peliid number(10), sortweight number(20), primary key(id));
  2. insert into pelidetail values (2558716,116600,40611005002558716);
  3. insert into pelidetail values (2558717,116600,40611005002558717);
  4. insert into pelidetail values (2558718,116600,40611005002558718);
  5. insert into pelidetail values (2558719,116600,40611005002558719);
  6. insert into pelidetail values (2558720,116600,40611005002558720);
  7. insert into pelidetail values (2558721,116600,40611005002558721);
  8. insert into pelidetail values (2558722,116600,40711035002558722);
  9. insert into pelidetail values (2558723,116600,40711035002558723);
  10. insert into pelidetail values (2558724,116600,40711035002558724);
  11. insert into pelidetail values (2558725,116600,40711035002558725);
  12. insert into pelidetail values (2558726,116600,40711035002558726);
  13. insert into pelidetail values (2558727,116600,40711035002558727);
  14. insert into pelidetail values (2558728,116600,41425072002558728);
  15. insert into pelidetail values (2558729,116600,41425072002558729);
  16. insert into pelidetail values (2558730,116600,41425072002558730);
  17. insert into pelidetail values (2558731,116600,41425072002558731);
  18. insert into pelidetail values (2558732,116600,41425072002558732);
  19. insert into pelidetail values (2558733,116600,50234022002558733);
  20. insert into pelidetail values (2558734,116600,50234022002558734);
  21. insert into pelidetail values (2558735,116600,50234022002558735);
  22. insert into pelidetail values (2558736,116600,50234022002558736);
  23. insert into pelidetail values (2558737,116600,51073066002558737);
  24. insert into pelidetail values (2558738,116600,51073066002558738);
  25. insert into pelidetail values (2558739,116600,51073066002558739);
  26. insert into pelidetail values (2558740,116600,51073066002558740);
  27. insert into pelidetail values (2558741,116600,51073066002558741);
  28. commit;

To read the values I use this sample code (query text is select id, sortweight from pelidetail where peliid=116600 order by id)

  1.     UnicodeString s;
  2.     int i=0, n, id;
  3.     __int64 res;
  4.     QDict->Open();
  5.     TField * fField[10];
  6.     for (n=0; n<QDict->Fields->Count; n++)
  7.         fField[n]=QDict->Fields->Fields[n];
  8.     Memo1->Clear();
  9.     for (; !QDict->Eof; QDict->Next()) {
  10.         id=fField[0]->AsInteger;
  11.         res=fField[1]->AsLargeInt;
  12.         s="";
  13.         s.sprintf(L"%d, %Ld\r\n", fField[0]->AsInteger, fField[1]->AsLargeInt);
  14.         Memo1->Lines->Append(s);
  15.         }
Output
  • 2558716, 40611005002558720

  • 2558717, 40611005002558720

  • 2558718, 40611005002558720

  • 2558719, 40611005002558720

  • 2558720, 40611005002558720

  • 2558721, 40611005002558720

  • 2558722, 40711035002558728

  • 2558723, 40711035002558728

  • 2558724, 40711035002558728

  • 2558725, 40711035002558728

  • 2558726, 40711035002558728

  • 2558727, 40711035002558728

  • 2558728, 41425072002558728

  • 2558729, 41425072002558728

  • 2558730, 41425072002558728

  • 2558731, 41425072002558728

  • 2558732, 41425072002558728

  • 2558733, 50234022002558728

  • 2558734, 50234022002558728

  • 2558735, 50234022002558736

  • 2558736, 50234022002558736

  • 2558737, 51073066002558736

  • 2558738, 51073066002558736

  • 2558739, 51073066002558736

  • 2558740, 51073066002558736

  • 2558741, 51073066002558744

  • So last digits are lost, although an __int64 can store them! Any solution?

    Sample code attached.