I understand that the version is 18.1. I understand that the dbgettablenum() command worked for you. The dbsettablenum() command doesn't. The db...() commands are all poorly designed, slow, and buggy. Don't use them. We've replaced them with a much better way to communicate with databases. Use the new way, not the broken, old way that does not work well and we do not support anymore.
Use the Database Connector object and the Database.Connection API. Both are available in FlexSim 18.1. See Help > FlexScript API Reference > Database.Connection. If you want to write to a database, use an INSERT INTO SQL statement. See the example in the description of Database.PreparedStatement in FlexSim 18.1's FlexScript API documentation.
Phil BoBo
Sr. Manager, Software Development