Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

siw2odbc: SQL Insert fails with single quotes in data
#1

When running siw2odbc-x64 on a new mysql database, the insert fails with the following:

Processing [Battery and Power Policy]
SiwODBC.cpp-470 SiwODBC::HandleDiagnosticRecord DSN=[SIW] RETCODE=-1
INSERT INTO siw_Scheduled_Tasks_Properties (siw_computer_id, siw_property_id, siw_detail_id, siw_Property, siw_Value) VALUES (33, 106, 4, 'Description', 'This task updates the cached list of folders and the security permissions on any new files in a userÆs shared media library.')
Datasource: [SIW] [MariaDB ODBC 3.0 Driver] [MariaDB 10.00.000033 siw][42000] [ma-3.0.2][10.0.33-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's shared media library.')' at line 1 (1064)
DSN=[SIW] RETCODE=-1
INSERT INTO siw_Battery_Power_Policy_Properties (siw_computer_id, siw_property_id, siw_detail_id, siw_Property, siw_Value) VALUES (33, 6, 2, 'Description', 'Saves energy by reducing your computerÆs performance where possible.')
Datasource: [SIW] [MariaDB ODBC 3.0 Driver] [MariaDB 10.00.000033 siw]
SiwODBC.cpp-486 SiwODBC::HandleDiagnosticRecord [42000] [ma-3.0.2][10.0.33-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's performance where possible.')' at line 1 (1064)
Processing [Printers]

After removing the apostrophe in the last field on both lines, the insert works OK.

Further note: the mysql database sql file that creates the tables creates many of them with lower case characters on the begging of the word, such as siw_bios_properties instead of siw_BIOS_Properties. After renaming the tables, all works OK.
Reply
#2

(11-25-2017, 02:00 AM)northsoundtech Wrote:  When running siw2odbc-x64 on a new mysql database, the insert fails with the following:

Processing [Battery and Power Policy]
SiwODBC.cpp-470 SiwODBC::HandleDiagnosticRecord DSN=[SIW] RETCODE=-1
INSERT INTO siw_Scheduled_Tasks_Properties (siw_computer_id, siw_property_id, siw_detail_id, siw_Property, siw_Value) VALUES (33, 106, 4, 'Description', 'This task updates the cached list of folders and the security permissions on any new files in a userÆs shared media library.')
Datasource: [SIW] [MariaDB ODBC 3.0 Driver] [MariaDB 10.00.000033 siw][42000] [ma-3.0.2][10.0.33-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's shared media library.')' at line 1 (1064)
DSN=[SIW] RETCODE=-1
INSERT INTO siw_Battery_Power_Policy_Properties (siw_computer_id, siw_property_id, siw_detail_id, siw_Property, siw_Value) VALUES (33, 6, 2, 'Description', 'Saves energy by reducing your computerÆs performance where possible.')
Datasource: [SIW] [MariaDB ODBC 3.0 Driver] [MariaDB 10.00.000033 siw]
SiwODBC.cpp-486 SiwODBC::HandleDiagnosticRecord [42000] [ma-3.0.2][10.0.33-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's performance where possible.')' at line 1 (1064)
Processing [Printers]

After removing the apostrophe in the last field on both lines,  the insert works OK.

Further note: the mysql database sql file that creates the tables creates many of them with lower case characters on the begging of the word, such as siw_bios_properties instead of siw_BIOS_Properties. After renaming the tables, all works OK.

Are you running the latest version of siw2odbc (2017 v7.8.1111b) ?
Reply
#3

(11-25-2017, 08:49 AM)Yes, it is the latest version. I also figured out part of the problem was that I was running the MariaDB version of the odbc drivers. I removed and installed the MySQL version, and most of the problems were resolved. I don\t know about the table names issue as I renamed each of them manually. The last import completed without any problems.-David gtopala Wrote:  
(11-25-2017, 02:00 AM)northsoundtech Wrote:  When running siw2odbc-x64 on a new mysql database, the insert fails with the following:

Processing [Battery and Power Policy]
SiwODBC.cpp-470 SiwODBC::HandleDiagnosticRecord DSN=[SIW] RETCODE=-1
INSERT INTO siw_Scheduled_Tasks_Properties (siw_computer_id, siw_property_id, siw_detail_id, siw_Property, siw_Value) VALUES (33, 106, 4, 'Description', 'This task updates the cached list of folders and the security permissions on any new files in a userÆs shared media library.')
Datasource: [SIW] [MariaDB ODBC 3.0 Driver] [MariaDB 10.00.000033 siw][42000] [ma-3.0.2][10.0.33-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's shared media library.')' at line 1 (1064)
DSN=[SIW] RETCODE=-1
INSERT INTO siw_Battery_Power_Policy_Properties (siw_computer_id, siw_property_id, siw_detail_id, siw_Property, siw_Value) VALUES (33, 6, 2, 'Description', 'Saves energy by reducing your computerÆs performance where possible.')
Datasource: [SIW] [MariaDB ODBC 3.0 Driver] [MariaDB 10.00.000033 siw]
SiwODBC.cpp-486 SiwODBC::HandleDiagnosticRecord [42000] [ma-3.0.2][10.0.33-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's performance where possible.')' at line 1 (1064)
Processing [Printers]

After removing the apostrophe in the last field on both lines,  the insert works OK.

Further note: the mysql database sql file that creates the tables creates many of them with lower case characters on the begging of the word, such as siw_bios_properties instead of siw_BIOS_Properties. After renaming the tables, all works OK.

Are you running the latest version of siw2odbc (2017 v7.8.1111b) ?
Reply




Users browsing this thread: 1 Guest(s)