Binary into SQL table field and viceversa

Hello I have a situation. I need to save a binary into an SQL table field then in other moment, I need to query that binary from SQL and then load it into a binary to finally load the binary into a memtable.

IS this possible?

Thanks in advance


I assume you are using Delphi.
it’s possible.

you can


Thanks for the answer. Yes I am using Delphi sorry.
I already had implemnted the SaveToStream but an error occurs (“Invalid stream”).
Actually i have the binary not the table then i do SaveToSream from the binary (binary.SaveToStream) I will try loading thn table from binary and then execute the SaveToStream is correct?

Thanks once

Sorry the error when i try to save the binary to Stream is not invalid stream, is “Stream write error”.


Binary is a descendant of TStream so you don’t need to save it to stream.

this error can be raised if you forgot to change stream position before read/write operations.

Can you create a simple testcase, say with PCTrade database, that reproduces these errors, pls?


I understand now and its solved thanks again.

until de next time.