The documentation for Firebird implies that you can write large (> 60K) strings to a blob value in a table. So if you have this:
CREATE TABLE MyBlobTable (
theId int PRIMARY KEY NOT NULL,
theBlob BLOB SUB_TYPE 1
)
Then this should work:
insert into MyBlobTable (theId, theBlob) values (1, '[60K characters in a string]')
(example inspired by http://web.firebirdsql.org/dotnetfirebird/blob-sub_type-1-reading-example-csharp.html)
But I've found that neither C# drivers nor FlameRobin can write this value. You get 'Unexpected end of command' (pointing to a spot about 32K into the string, which is a little suspicious)
I figure there is a special way to quote or escape the data values, or maybe a C# equivalent of this Java code (http://www.firebirdfaq.org/faq372/) where a binary file is read directly into the statement. I'm not doing anything fancy with the text data so I'm open to storing it as a binary blob if needed.
Thanks!
Update: "parameterized queries" is the phrase that I was looking for. What I'm doing:
FbParameter param = new FbParameter("@blobVal", FbDbType.Text);
param.Value = myLargeString;
String query = "insert into MyBlobTable (theId, theBlob) values (1, @blobVal)";
using (FbConnection conn = [something from my pool]) {
using (FbCommand cmd = new FbCommand(query, conn)) {
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();
}
}