So, what is the benefit of the Query Supervisor and how can you use it in your SAP landscape? If you keep your systems current with PTF levels, you may have already installed those PTF levels and can start using the Query Supervisor now. If anyone needs/wants a method for inserting/updating values within the IBM AS/400, leave a comment and I'll share.In May 2021, IBM has introduced the Query Supervisor with Db2 for i PTF Group SF99704 Level 13 for IBM i 7.4 and Db2 for i PTF Group SF99703 Level 24 for IBM i 7.3. It returns a DataSet of the results returned. Fill the data set with the results of the data adapterĪnd you would use it like so: DataSet results = query_iseries("YOUR DATA SOURCE", "YOUR SQL QUERY", new string ) Using (OleDbDataAdapter data_adapter = new OleDbDataAdapter(command)) Create a data adapter to hold results of the executed command OleDbCommand command = new OleDbCommand(query, iseries_connection) įor (int i = 0 i < parameterName.Count() + parameterName, parameterValue) Using (var iseries_connection = new OleDbConnection(datasource)) Open a new stream connection to the iSeries NET but none of the answers above worked and so I ended up creating my own method using OleDb: public DataSet query_iseries(string datasource, string query, string parameterName, string parameterValue) Performance likely isn't blinding fast, but it works.Įxtremely old question - but this is still relevant. The conversion from RecordSet to DataTable is a little clunky and gave me bad flashbacks to my VBScript days. "jdbc:as400:" + ServerName + " prompt=false", UserName, Password) I found several hints and small snippets of code but nothing comprehensive so I wanted to share what I was able to build up in case it helps someone else: using ĭriverManager.registerDriver(new .AS400JDBCDriver()) Ĭonnection conn = DriverManager.getConnection( In my case I needed to query a DB2 database on an AS400 and output a DataTable. You'll need the nuget package JT400.78 which will pull in the IKVM Runtime. If you don't have the IBM i Access software, you can leverage JTOpen and use the Java drivers. As mentioned in other answers, if you have the IBM i Access client already installed, you can use the package.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |