TIBCScript: ExecuteStream

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

TIBCScript: ExecuteStream

Post by upscene » Fri 09 Aug 2013 07:49

Hi,

What kind of Stream does this expect? Does it have to include an Encoding BOM?

Or does it expect a UnicodeString stream?

with regards,

Martijn Tonies

AndreyZ

Re: TIBCScript: ExecuteStream

Post by AndreyZ » Fri 09 Aug 2013 12:40

Hello,

If first two bytes are FFFE, the Unicode encoding (two bytes per symbol) is used. If first two bytes are EFBB, the UTF-8 encoding (four bytes per symbol) is used. Otherwise, the default encoding (one byte per symbol) is used.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: TIBCScript: ExecuteStream

Post by upscene » Fri 09 Aug 2013 12:45

Hello Andrey,

Right, so a BOM is expected for Unicode.

Thanks.

AndreyZ

Re: TIBCScript: ExecuteStream

Post by AndreyZ » Fri 09 Aug 2013 13:21

Glad to help. If any other questions come up, please contact us.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: TIBCScript: ExecuteStream

Post by upscene » Fri 09 Aug 2013 14:45

One more thing :)

How does it parse the script in the stream, does it load the entire stream into memory, or does it load from the stream until a full statement is found?

I'd like to know if this method can be used to execute (very) large scripts.

with regards,

Martijn Tonies

AndreyZ

Re: TIBCScript: ExecuteStream

Post by AndreyZ » Mon 12 Aug 2013 08:20

TIBCScript reads the data from the stream by 64 Kb chunks. When the next chunk of data is needed, the previous chunk is released.
To execute large scripts, you should use the TFileStream class, as it does not load all file (with the script) to the memory.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: TIBCScript: ExecuteStream

Post by upscene » Mon 12 Aug 2013 08:25

Excellent, thanks!

AndreyZ

Re: TIBCScript: ExecuteStream

Post by AndreyZ » Mon 12 Aug 2013 09:04

Feel free to contact us if you have any further questions about IBDAC.

Post Reply