Hi!

At 08:57 AM 11/12/01 -0800, you wrote:
>>
>> how do you communicate the binary strings to MySQL? From the manual I
>> found:
>>
>> "
>> If you want to insert binary data into a BLOB column, the following
>> characters must be represented by escape sequences:
>>
>> NUL
>> ASCII 0. You should represent this by `\0' (a backslash and an ASCII
>> `0' character).
>> \
>> ASCII 92, backslash. Represent this by `\\'.
>> '
>> ASCII 39, single quote. Represent this by `\''.
>> "
>> ASCII 34, double quote. Represent this by `\"'.
>> If you write C code, you can use the C API function
>> mysql_escape_string() to escape characters for the INSERT statement.
>> See section 8.4.2 C API Function Overview. In Perl, you can use the
>> quote method of the DBI package to convert special characters to the
>> proper escape sequences. See section 8.2.2 The DBI Interface.
>>
>> You should use an escape function on any string that might contain any
>> of the special characters listed above!
>> "
>>
>> Try also inserting rows to your table from the mysql command line
>> client. Does that work? Does MyODBC work if you insert simple ASCII
>> strings (not binary strings) in place of the BLOBs:
>> 'jhghjghgjgjgjkgkjhhj'.
>>
>> Regards,
>>
>> Heikki
>
>Heikki,
>
>Manually inserting text into the blob fields work fine. I was also able to
>convert the table type from MyISAM to INNODB and the blob fields stayed
>intact. I guess there must be some unescaped sequence in the blobs that is
>preventing the insertion of the first record when the table type is innodb.
>I'm not sure how (or where) you would include an escape function in
>Access97. I don't see any obvious switch that can be set in MyODBC either.
>Any suggestions? I will post the problem to the MyODBC list.

You could try to insert the first row from the command line: cut it from the
query log and feed it to mysql, on Unix e.g.:

mysql yourdatabasename < atextfilecontainingtheinsertstatement

The query log seemed to contain correctly escaped characters.

Or you can send the insert statement to [EMAIL PROTECTED] who is responsible
for MyODBC, I think. I am Ccing this email to Venu.

>Thanks,
>Stephen

Regards,

Heikki
http://www.innodb.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to