Michael Sansoterra
Michael Sansoterra is a DBA for Broadway Systems in Grand Rapids, Michigan.
-
Microsoft .NET 2.0 for System i Developers: Building Windows Forms Using the DataGridview Control
February 13, 2008 Michael Sansoterra
This is the third in a series of articles by Michael Sansoterra on Microsoft .NET 2.0.
Note: The code accompanying this article is available for download here.
Part 1 and Part 2 of this series provided a general introduction to using .NET with the IBM System i. Attention was given to how much could be done in .NET without any coding at all. Part 1 started with a trivial example of how to build an interactive Web page capable of editing data in a DB2 table using ASP.NET. Part 2 built on that foundation by AJAX-enabling the majority of
-
Use SQL User-Defined Functions to Avoid Data Repetition Problems
December 12, 2007 Michael Sansoterra
By now, most System i and AS/400 developers know they can enhance the SQL language in DB2 for i5/OS by creating their own user-defined functions (UDFs). In this tip I’d like to focus on one common problem encountered when writing queries and how a simple UDF template can often solve this problem.
By way of review, in case you’re not familiar with them, UDFs are pieces of code that can bolt onto SQL. UDFs usually contain business logic for doing complex tasks that would be difficult or cumbersome to do using the SQL built-in functions. There are a variety of
-
System i Developers and .NET 2.0, Part 2: Web Development Using ASP.NET AJAX
November 28, 2007 Michael Sansoterra
Note: The code accompanying this article is available for download here.
In System i Developers and .NET 2.0: ASP.NET and the Declarative Programming Model, which is Part 1 of this series, I did a jet tour of the basics of .NET 2.0 and tried to present compelling reasons why System i programmers might want to learn it. Among the listed reasons to learn .NET are popularity (with a large supporting community), versatility and the ability to integrate with the AS/400 and System i world. Part 1 also presented a step-by-step scenario on how to create a basic ASP.NET
-
Wrapping Free Form Text
October 31, 2007 Michael Sansoterra
Note: The code accompanying this article is available for download here.One common integration problem encountered by those building client/server or Web-based interfaces to a legacy green-screen application is mapping a free form text field into a fixed width field. This tip presents a code segment I wrote to solve this problem.
For example, say you have the following DDS defined legacy table called ORDCOMT that is designed to store the comments for a customer order:
Column
Data
TypeDescription
ORDID
7P,0
Order Id
CMTSEQ
3P,0
Comment
SequenceCMTTXT
25A
Comment
TextIn the legacy application, a customer service
-
Programmatically Import Excel Worksheets Using IBM’s ActiveX Object Library
October 10, 2007 Michael Sansoterra
Note: The code accompanying this article is available for download here.
Everybody likes to export DB2 data to an Excel spreadsheet. It’s quick and easy, and there are plenty of ways to do it. On the other hand, I’m often asked by people, including fellow developers, to assist them with importing an Excel worksheet into a DB2 table. In fact, what developer hasn’t had the experience of a bean counter asking for assistance in uploading a spreadsheet into an ERP system?
Importing native Excel worksheets has always had some measure of difficulty. There are headings to worry about, date
-
System i Developers and .NET 2.0: ASP.NET and the Declarative Programming Model
September 19, 2007 Michael Sansoterra
Note: The code accompanying this article is available for download here.
IBM’s AS/400 platform (now called the System i) boasts a wonderful history of almost 20 years. Those faithful to the platform well know its strengths and the ingenuity IBM has put into the box, which have allowed it to be successful for so long. That being said, it is no secret that many System i shops maintain legacy applications using old tools. That, in turn, has often left developers out of touch with current developer tools and languages. With so many options, it is difficult to know how
-
Load a Spreadsheet from a DB2/400 Database: Part 2
July 11, 2007 Michael Sansoterra
Note: The code for this article is available for download here
Ted Holt’s tip on loading database data into Excel was great. I’d like to offer a few potential enhancements to the VBA code that was offered in the tip.
The first thing that I would like to note is that if you want to copy all rows and columns from an ADO recordset (an object that holds the results of a query) into the spreadsheet, then there is a CopyFromRecordset method of the Range object to do this:
ws.Range("A2").CopyFromRecordset Rs
In the original code sample, row one was reserved
-
Overcome the Page Control Limitations of iSeries Access Printer Emulation Sessions
May 2, 2007 Michael Sansoterra
Over the years, iSeries Access virtual printer emulation sessions have been used to successfully print a variety of spool file reports from System i and AS/400 systems to a local PC printer. Regardless of the report’s page attributes (page orientation, lines per inch, characters per inch, number of columns, etc.), the printer emulator will often successfully and automatically correct the output and automatically adjust the spool file’s page settings to print successfully to a local printer. However, in other cases it seems like it takes quite a bit of tinkering to get various spool files to print correctly to a
-
SQL Cross Platform Interoperability: The Proper Function
February 7, 2007 Michael Sansoterra
The code accompanying this article is available for download
This tip has one very easy point: There’s lot of reusable SQL code out there, and System i (AS/400) DB2 developers can take advantage of it. Even though SQL’s promise of cross platform independence has never materialized, there are still enough similarities to make conversion between platforms worthwhile. All it takes is a little practice.
This tip assumes you have some knowledge of writing SQL modules (triggers, functions or stored procedures in the SQL language). If you’re new to this arena, review the Control State section in the IBM SQL Reference
-
Using the SQL SET OPTION Statement
January 24, 2007 Michael Sansoterra
SQL’s SET OPTION statement is a powerful way to control the parameters of the DB2 execution environment in which an SQL program runs. Using it properly will allow SQL code to execute consistently between different environments–including those thorny differences that often arise between green screen and client/server environments. Read on to find out why this statement is essential to embedded SQL programs and persistent stored modules (SQL based triggers, procedures and functions).
First of all, SET OPTION is a statement that is evaluated at “compile time.” It never actually gets executed. Therefore SET OPTION can only be specified once in