Jump to content

How to write back to GreenPlum (PostgreSql Database)


Xiongyi Gao

Recommended Posts

Hi All,

My project requires to provide data entries and allow users to key in new values and insert rows into database using Spotfire. I'm trying to use IronPython to solve it but I don't know what should I use for the client type and connection string in the following code. I can find sample code for Oracle and SQL database, but how about Greenplum database Is there any way I can write back new data to this database

Here is my code, but it doesn't work:

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 test.test(account,name) VALUES('10019','test');"

dbsettings=DatabaseDataSourceSettings( "System.Data.SqlClient","Server=myServer;Database=myDs;UID=myID;PWD=myPWD",sqlCommand)

ds = DatabaseDataSource(dbsettings)

newDataTable = Document.Data.Tables.Add("temp",ds)

Document.Data.Tables.Remove(newDataTable)

 

Thanks.

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...