Subject RE: [ib-support] Help with query
Author Dan Cumpian
Helen,

I changed the TMemeoryStream to a TBlobStream, created a persistent
field that referenced the blob field and still received the exact same
error. The data I am trying to insert contains a UUencoded binary file.
It is all text (ASCII), but Interbase is choking on one or more
characters in the body of the text.

Here is a sample (in case you've never worked with UUE data):

M85B57(YZY5X;<I6BF'[)@HNC+DMKBG]#7E+D65?C[QWZ8NIOB"BDIK)#\7RG
MHLI(5140=2,I#7\ME0S]$JB5I%VNTMN($&?QM?&;/%7'X]I*=5A<YWY7X:FJ
MS=2Q"L4VLM2D48GDIUGAP^F@"1:7(Y=V\>('!BWJ>F.A[RBZK<1'W"&]N,=9
MD%NS*?21S,<QL10\7:VMV[9'UMVZH=Y1=5N(;A#>W&25-V@K*;&X7=ZL3#7B
MMY4V`A1\L;<46_JW02=BEQ&S%(%@/*C73M>_''HT(,MY"[LP?^?H;^K=`V*7
M%$S!*,E.IH>K/YJFJW8P.I=$RO+<R.BH'HU,6NN9[DWXOY4U56Y$),V4BHME
MA7TV4#0QR7,-YCELJA<X&U]-KAOX@&UM5_V=I.ZGBS@FV6JY2LF0(]4SE_J6
MV<F?%5CB[$?>,O'AI)T*`D'H[T/$9ZF1CD^4EFLT+C51IQ=B'%VL62;.A1ZV
M>IQ)@-1F@]0)U)$M6O@SSH=.(=K9&SF6RA1@/]=<ST?R=!Z@7S8PFJ<C$JW,
M=!KL1_0R_G+GB!!F1IYX+2=1\@P>H'PH0 @=!=YC0"AQ2]N56 ?,DNF?1-(?
M9R*$JE5%TMI),VN>],S:"G2C##TR/EP\Q#S(@NX=7LUFQL+N$@'N8MJ>@R8H
MY]!1:2Z753*W&5<VN2Q6\PQR_,1%4PN-F-%B**S >F)V!)-A?'S ZZ=L/^AX
MDR?#R1:JJWZ1*F5VJWV#'.&-YB0Y@8X>DY:Z5L9PNYV3G:4A8I\.9D0V?4X3
MYQ7[3%K+\*01N1<K=LJIF,10JKTR-U1]D/&^F>S&'(Q^2*R[+CB:!PET$-M2
M@ @8H#<\;?2+TQJB++#J7#:IZ+!DTQ\Z$7OR+K\G]$L924L$Q:>(R^$&+5Z%
M`\Y2[?[ET>*]'Y;ODO1\T]>9]0^C85^&87*MV>33'HTCOR+K\G]$IQWAIBV>
M>3(?DB3YJF.8Z)RIM3ES-(H[+[.7;IH#7L'#G,M^T5Q68?(E0H]V5]^@;Y%>
MW$75@&!>XA89H+2E,=U,=8W]+<R"RH&QS&&$FI+,4&+[S@K^#PKU@@LS9^0;

As you can see, there are all kinds of characters in there...

Any ideas?

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,
>
>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
an
>error "invalid token '" when I try to do the insert. I tried doubling
>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
having
>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/