Write back to database from Spotfire

Hello,

I am using below code to write back to my database table:

from System import Array,String,Object
from System.IO import Path, File, StreamWriter
from Spotfire.Dxp.Data import DataTableSaveSettings
from Spotfire.Dxp.Data.Import import TextFileDataSource
from Spotfire.Dxp.Data.Import import TextDataReaderSettings

from Spotfire.Dxp.Application.Visuals import TablePlot
from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers

from Spotfire.Dxp.Data.Import import DatabaseDataSource
from Spotfire.Dxp.Data.Import import DatabaseDataSourceSettings

sqlCommand="INSERT INTO datafabric_dea.student_dummy(name,marks) VALUES('test','80');"
dbsettings=DatabaseDataSourceSettings( "System.Data.SqlClient","Server=10.93.20.152;Database=gehc_data;UID=502635716;PWD=******",sqlCommand)
ds = DatabaseDataSource(dbsettings)
newDataTable = Document.Data.Tables.Add("temp",ds)
Document.Data.Tables.Remove(newDataTable)

On executing this code i am getting the following error:

Spotfire.Dxp.Data.Exceptions.ImportException: Failed to execute data source query. ---> Spotfire.Dxp.Data.Exceptions.ImportException: Failed to execute data source query. ---> System.InvalidOperationException: User input is need

Please help me debug this. I am not sure what user input is required over here.

Regards,
Prateek

(1) Answer

Login