Recent

Author Topic: TBufDataset procedure LoadFromStream, Loses Primary Key  (Read 328 times)

adilsonpazzini

  • New Member
  • *
  • Posts: 25
TBufDataset procedure LoadFromStream, Loses Primary Key
« on: October 28, 2019, 08:25:22 pm »
Good afternoon,
I have problems with the procedure "BufDataset1.LoadFromStream (DatasStream, dfBinary);"
When loading data from a TSQLQuery from a table, it loses Primary Key information

Here's an example, for Firebird 3 with Lazarus 2.0.4 Fpc - 3.0.4 .. it was also tested with MySQL and Postgres.


Thank you very much in advance
Adilson Pazzini

Thaddy

  • Hero Member
  • *****
  • Posts: 9278
Re: TBufDataset procedure LoadFromStream, Loses Primary Key
« Reply #1 on: October 28, 2019, 08:52:05 pm »
TBufDataset is not supposed to keep index data.
also related to equus asinus.

adilsonpazzini

  • New Member
  • *
  • Posts: 25
Re: TBufDataset procedure LoadFromStream, Loses Primary Key
« Reply #2 on: October 28, 2019, 09:36:27 pm »
Curiosity, but why not?

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7589
Re: TBufDataset procedure LoadFromStream, Loses Primary Key
« Reply #3 on: October 28, 2019, 11:07:52 pm »
I'm not too deep in this matter, but you don't really load the dataset from the query, but store it as binary inbetween.

That (the streaming) might be step that loses the sql metadata.

adilsonpazzini

  • New Member
  • *
  • Posts: 25
Re: TBufDataset procedure LoadFromStream, Loses Primary Key
« Reply #4 on: October 29, 2019, 12:36:57 pm »
In the tests this is what I understood, the transfer is losing this information .. and only the Primary Key information

Strange, because if BufDataset should not have this option, then why have the option to inform InKey

I appreciate the return

Adilson Pazzini
« Last Edit: October 29, 2019, 01:15:13 pm by adilsonpazzini »