This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Problem trying to INSERT INTO ServiceControl table
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Feb 27, 2008
04:02 AM
Problem trying to INSERT INTO ServiceControl table
Hi,
I'm trying to update the ServiceControl table at runtime (the names and number of our service instances can be setup by users and are therefore unknown to us until runtime). I'm using a custom action that calls the MsiDatabaseOpenView function. I've stepped through a debugger and the sqlquery passed to the function appears as:
"INSERT INTO `ServiceControl`(`ServiceControl`.`ServiceControl`,`ServiceControl`.`Name`,`ServiceControl`.`Event`,`ServiceControl`.`Arguments`,`ServiceControl`.`Wait`,`ServiceControl`.`Component_`)VALUES('ServiceEvent11809','DOORS DB Server 9.0 00001',160,'one',1,'ControlService1') TEMPORARY"
The function is returning an ERROR_BAD_QUERY_SYNTAX from this statement, I can't see any errors in it, can anyone see any problems with the sql statement, or what I'm trying to do?
Thanks.
I'm trying to update the ServiceControl table at runtime (the names and number of our service instances can be setup by users and are therefore unknown to us until runtime). I'm using a custom action that calls the MsiDatabaseOpenView function. I've stepped through a debugger and the sqlquery passed to the function appears as:
"INSERT INTO `ServiceControl`(`ServiceControl`.`ServiceControl`,`ServiceControl`.`Name`,`ServiceControl`.`Event`,`ServiceControl`.`Arguments`,`ServiceControl`.`Wait`,`ServiceControl`.`Component_`)VALUES('ServiceEvent11809','DOORS DB Server 9.0 00001',160,'one',1,'ControlService1') TEMPORARY"
The function is returning an ERROR_BAD_QUERY_SYNTAX from this statement, I can't see any errors in it, can anyone see any problems with the sql statement, or what I'm trying to do?
Thanks.
(3) Replies
‎Feb 27, 2008
05:32 AM
"INSERT INTO `ServiceControl`(`ServiceControl`.`ServiceControl`,`ServiceControl`.`Name`,`ServiceControl`.`Event`,`ServiceControl`.`Arguments`,`ServiceControl`.`Wait`,`ServiceControl`.`Component_`)VALUES('ServiceEvent11809','DOORS DB Server 9.0 00001',160,'one',1,'ControlService1') TEMPORARY"
Try this
"INSERT INTO `ServiceControl`(`ServiceControl`.`ServiceControl`,`ServiceControl`.`Name`,`ServiceControl`.`Event`,`ServiceControl`.`Arguments`,`ServiceControl`.`Wait`,`ServiceControl`.`Component_`) VALUES ('ServiceEvent11809','DOORS DB Server 9.0 00001',160,'one',1,'ControlService1') TEMPORARY"
Note the spaces before and after VALUES
Also ensure that the fields you are inserting into have the correct datatype e.g. string, long etc and you are specifying the correct number of fileds per row.
Try this
"INSERT INTO `ServiceControl`(`ServiceControl`.`ServiceControl`,`ServiceControl`.`Name`,`ServiceControl`.`Event`,`ServiceControl`.`Arguments`,`ServiceControl`.`Wait`,`ServiceControl`.`Component_`) VALUES ('ServiceEvent11809','DOORS DB Server 9.0 00001',160,'one',1,'ControlService1') TEMPORARY"
Note the spaces before and after VALUES
Also ensure that the fields you are inserting into have the correct datatype e.g. string, long etc and you are specifying the correct number of fileds per row.
‎Feb 27, 2008
01:22 PM
Windows Installer has halfhearted SQL support, so you may find it easier to use their record-based interface. Open a view on the table (select *), create a record with MsiCreateRecord (or its equivalent in the language you are using), populate it with MsiRecordSet{String,Integer}, and insert it with MsiViewModify.
‎Mar 03, 2008
09:34 AM
MichaelU wrote:
Windows Installer has halfhearted SQL support, so you may find it easier to use their record-based interface. Open a view on the table (select *), create a record with MsiCreateRecord (or its equivalent in the language you are using), populate it with MsiRecordSet{String,Integer}, and insert it with MsiViewModify.
Thanks very much, I changed the code to use the record-based interface, and it appears to be working now. 🙂