Skip to main content

Environment: VS2015, VC2.3, Win 10, MySQL 5.7, character set UTF8 (default)

Hi,

I'm getting an exec sql error inserting extended ascii into a mysql varchar field:

"[MySQL][ODBC 5.3(w) Driver][mysqld-5.7.12-log]Incorrect string value: '\\xA3150 o...' for column 'linage_rec_text' at row 1"

I can type £ into the field directly in MySQL workbench but get the error via exec sql.

What's the correct way to handle this? I need to store extended ascii characters from MF Dialog system text input fields.

My (host) field is defined as pic x(n).

ODBC DRIVER: I'm using 32 bit MySQL ODBC 5.3 unicode driver - should I be using the ANSI driver instead?

Any help much appreciated.

Linden       

                                                                                                                                                                                                                                                                                                                                                                                   

Environment: VS2015, VC2.3, Win 10, MySQL 5.7, character set UTF8 (default)

Hi,

I'm getting an exec sql error inserting extended ascii into a mysql varchar field:

"[MySQL][ODBC 5.3(w) Driver][mysqld-5.7.12-log]Incorrect string value: '\\xA3150 o...' for column 'linage_rec_text' at row 1"

I can type £ into the field directly in MySQL workbench but get the error via exec sql.

What's the correct way to handle this? I need to store extended ascii characters from MF Dialog system text input fields.

My (host) field is defined as pic x(n).

ODBC DRIVER: I'm using 32 bit MySQL ODBC 5.3 unicode driver - should I be using the ANSI driver instead?

Any help much appreciated.

Linden       

                                                                                                                                                                                                                                                                                                                                                                                   

May have answered my own question ... switched to the ANSI OBDC driver and that seems to have fixed it.

Environment: VS2015, VC2.3, Win 10, MySQL 5.7, character set UTF8 (default)

Hi,

I'm getting an exec sql error inserting extended ascii into a mysql varchar field:

"[MySQL][ODBC 5.3(w) Driver][mysqld-5.7.12-log]Incorrect string value: '\\xA3150 o...' for column 'linage_rec_text' at row 1"

I can type £ into the field directly in MySQL workbench but get the error via exec sql.

What's the correct way to handle this? I need to store extended ascii characters from MF Dialog system text input fields.

My (host) field is defined as pic x(n).

ODBC DRIVER: I'm using 32 bit MySQL ODBC 5.3 unicode driver - should I be using the ANSI driver instead?

Any help much appreciated.

Linden       

                                                                                                                                                                                                                                                                                                                                                                                   

You should really be using the host variable type binary instead of pic x fields when inserting non-displayable characters into a column.

There is also a compiler directive SQL(ALLOWNULLCHAR) which allows you to use pic x for this purpose.

Environment: VS2015, VC2.3, Win 10, MySQL 5.7, character set UTF8 (default)

Hi,

I'm getting an exec sql error inserting extended ascii into a mysql varchar field:

"[MySQL][ODBC 5.3(w) Driver][mysqld-5.7.12-log]Incorrect string value: '\\xA3150 o...' for column 'linage_rec_text' at row 1"

I can type £ into the field directly in MySQL workbench but get the error via exec sql.

What's the correct way to handle this? I need to store extended ascii characters from MF Dialog system text input fields.

My (host) field is defined as pic x(n).

ODBC DRIVER: I'm using 32 bit MySQL ODBC 5.3 unicode driver - should I be using the ANSI driver instead?

Any help much appreciated.

Linden       

                                                                                                                                                                                                                                                                                                                                                                                   

Thanks Chris, i'll experiment with allownullchar. If I use binary can that still go to varchar? They're not non display e.g. UK pound sign, accented letters etc. Do you know why it would work with the ansi ODBC and not the unitype? A problem I have is that i'm trying to use existing (we have many) record layouts so that the legacy programs don't know the difference. Perhaps in the end I'll have to sort it out field by field though with 'binary' etc. Seems to be working though now with the ANSI ODBC.