I have a Stored Procedure where DBConnection in the Gateway has the name Production_DB
Here is my test script.
dbnameconnect =system.db.beginTransaction(database = “Production_DB”)
call = system.db.createSProcCall(“Production_DB.dbo.usp_iiot_IgnitionDatasetfromSP”,dbnameconnect)
dataset = system.db.execSProcCall(call)
normaldataset = system.dataset.toDataSet(dataset)
The following errors occur
Error executing system.db.execSProcCall()
caused by: com.inductiveautomation.ignition.gateway_interface.Gatewayexception: DataSource “c9c2f1f7-5fe3-4979 etc” does not exist in this gateway.
The Production_DB is configured as a name database connection.
beginTransaction doesn’t return a database connection. It just returns a transaction ID. You need to pass the database and that transaction ID separately to createSProcCall.
Also, execSProcCall doesn’t return anything that can be converted to a dataset. You need to use getResultSet() on that returned object. The manual I linked has examples.
You failed. Look at the quotes in your reposted code block. They've been auto-converted to "pretty" quotes. The whole point of asking the OP edit their own comment's pasted text is because their post still has the original characters and spaces.
What would be the syntax of system.db.createSProcCall(“Production_DB.dbo.usp_iiot_IgnitionDatasetfromSP”,dbnameconnect)
if my Ignition Database connection Name is Production_DB.
Please edit your original post to mark the pasted code as a code block (highlight the code and click the </> button). Then I can cut and paste to show you.
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Database ‘Production_DB’ does not exist. Make sure that the name is entered correctly.
Production_DB is the name of the Database connection in Galaxy
The DB in SQL server that this is connected to is Production-DB.
Thank you for help.