Subject | RE: [ib-support] Help with query |
---|---|
Author | Dan Cumpian |
Post date | 2003-01-16T03:03:58Z |
Helen,
Thanks for the reply.
The Blob field is Subtype 0. The error message is:
Dynamic SQL Error. SQL Error Code = -104
Unexpected end of command.
Invalid token '.
The MsgStream I am using is a TMemoryStream. How can I use a
TBlobStream on
an insert query that contains no field information?
The SQL string in the query is :
Insert into messages (body) values (:body)
Any advice is much appreciated...
Thank you,
Dan Cumpian
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Wednesday, January 15, 2003 9:31 PM
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Help with query
At 08:45 PM 15/01/2003 -0500, you wrote:
Blob sub_type 0 doesn't care what is in the blob. It just has to be a
blob.
Blob sub_type 1 is hooked to a filter that expects ascii text. As long
as
the data is all ascii text, it doesn't care about the content, e.g. such
things as escaping apostrophes and what have you.
You can put text data into blob sub_type 0 but you can't put binary data
into blob sub_type 1.
I wouldn't be too categorical that a wrong blob sub_type is causing your
problem, though. A message containing "invalid token" usually indicates
bad SQL. Are you sure that you are passing a blob and not a string? If
your MsgStream argument is not a TBlobStream, your TParam.LoadFromStream
call won't be valid.
Firebird can accept a string as input to a text blob, but InterBase
can't...
What is the *full text* of the error message you are getting?
heLen
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Thanks for the reply.
The Blob field is Subtype 0. The error message is:
Dynamic SQL Error. SQL Error Code = -104
Unexpected end of command.
Invalid token '.
The MsgStream I am using is a TMemoryStream. How can I use a
TBlobStream on
an insert query that contains no field information?
The SQL string in the query is :
Insert into messages (body) values (:body)
Any advice is much appreciated...
Thank you,
Dan Cumpian
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Wednesday, January 15, 2003 9:31 PM
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Help with query
At 08:45 PM 15/01/2003 -0500, you wrote:
>Hello,an
>
>I figured out how to save a BLOB to an Interbase database, but I am
>running into a problem due to the contents of the Blob.
>
>I am using the following code to insert the blob:
>
>MessageBody.SaveToStream(MsgStream);
>DMMySQL.QryStoreBody1.ParamByName('PartID').Value:=JobParams;
>(DMMySQL.QryStoreBody1.Params[1] as
>TParam).LoadFromStream(MsgStream,ftBlob);
>
>The problem is that the blob is an encoded NNTP message. I am getting
>error "invalid token '" when I try to do the insert. I tried doublinghaving
>the "'" characters, and this does work for some text, but it fails on
>others. How can I get Interbase to accept the entire blob without
>to "doctor" it first?In InterBase, there are different kinds of blobs.
Blob sub_type 0 doesn't care what is in the blob. It just has to be a
blob.
Blob sub_type 1 is hooked to a filter that expects ascii text. As long
as
the data is all ascii text, it doesn't care about the content, e.g. such
things as escaping apostrophes and what have you.
You can put text data into blob sub_type 0 but you can't put binary data
into blob sub_type 1.
I wouldn't be too categorical that a wrong blob sub_type is causing your
problem, though. A message containing "invalid token" usually indicates
bad SQL. Are you sure that you are passing a blob and not a string? If
your MsgStream argument is not a TBlobStream, your TParam.LoadFromStream
call won't be valid.
Firebird can accept a string as input to a text blob, but InterBase
can't...
What is the *full text* of the error message you are getting?
heLen
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/