How much sense does it make to place into your operating system a feature that requires a separate licensed program to use it? Not much, but IBM is doing exactly that with the SQL Stored Procedure language on the AS/400.
Power to the People
For those of you not in the loop, IBM has added to the AS/400 the greatest feature since the bread-slicing attachment. The AS/400 Stored Procedure language allows you to code SQL stored procedures in a simple extended SQL grammar. The language is easy to learn and even easier to use, and it opens up the AS/400 to the great unwashed masses.
Let me give you an overview of the process of using the language and of how the language is implemented. The intrepid programmer submits a Create Procedure command to SQL on the AS/400 (through any interface capable of running SQL statements). The Create Procedure command takes the stored procedure code and creates a straightforward C program that contains embedded SQL calls. This C program is a lot longer than the original SQL procedure code but correctly implements the logic that the programmer is attempting to put on the AS/400. Next, the Create Procedure command compiles the C code into a working AS/400 program by using the ILE C compiler, and voilà! Instant stored procedure nirvana.
I havent been this happy since I got that chemistry set for St. Swizzens Day! Now anyone can call SQL procedures by using the SQL Call Level Interface (CLI) via OLE DB, ODBC, Client Access APIs, RPG, COBOL, CL, REXX, etc. In addition, the procedure is now callable from everywhere. This allows access from an array of interfaces to the business logic the procedure is defined to perform. This is distributed computing easily implemented.
However, did you notice something in the above chain of events besides my exuberance? The C compiler plays a role in procedure creation. In fact, the Stored Procedure language cannot be used unless you have a C compiler. I have a C compiler, but it seems like every client I visit does not. Here is this beautiful stored procedure language, built right into the operating system, that most AS/400 shops cannot use, because they use RPG, not C.
The Argument for C
Now, I have not seen a COBOL compiler since 1984. (It was a terrible relationship. I kept having to explain the plot of the files to her over and over again, so we broke it off, and Ive been dating a C compiler ever since.) C and I have a love/hate relationship: C loves to point out my pointer faults, and I hate C for requiring me to declare my memory usage in the finest detail. C is a fantastic language for system programming but, IMHO, is not a great language for application programming. C can be a really difficult and obfuscating language, especially when dealing with pointers, but there are some things that I can do in C that I just cant see myself doing in any other language (except maybe Prolog).
That said, I completely understand IBM choosing to interpret the SQL procedure grammar and output a C program. C can be tamed into a simple and straightforward language, and the output of the Create Procedure command is very readable and easily understandable C code. The stored procedure feature works; IBM has done a bang-up job implementing the Stored Procedure language.
Still, I have a real problem with IBM requiring customers to have the C compiler to use the Stored Procedure language. Here is a feature built into the operating system, but you had better buy this extra package in order to use it. Also, you must have the DB2 UDB Query Manager and SQL Development Kit installed, or else the C compiler wont be able to compile the embedded SQL created in the SQL procedure. Basically, here are two items you must have to be able to use the coolest feature ever built into the AS/400.
Whats It All Mean, Mr. Natural?
IBM is attempting to make the AS/400 more and more like UNIX, so why doesnt it complete the transition and include the C compiler as part of the operating system? In addition, with SQL built into the AS/400 and accessible from PC client applications for free via ODBC and OLE DB, why doesnt it make DB2 UDB Query Manager and SQL Development Kit free as well? I really have a problem with the operating system coming with a feature that my clients cannot use unless they buy these extra products. As an alternative to giving away the C compiler and SQL Development Kit, maybe IBM could make a special version of the compiler and kit that is installed in every AS/400 but can be called only by the Create Procedure command.
I can tell you one thing: PC/Web programmers and people who want to interface with legacy AS/400 systems would embrace the procedure language if it were truly available on all AS/400 machines. Accessibility of the language would assure PC/Web programmers that they could place application logic on the AS/400 without having to write C, COBOL, or RPG programs themselves. In addition, giving away the compiler would bring the SQL Stored Procedure language to the masses and really make the AS/400 an open system. Come on, IBM. Lets light this candle.
LATEST COMMENTS
MC Press Online