Hi Jerry,
The utility does come with default templates for things such as read,
write, update, and delete. I suggest running it as is just to get an
idea of how the resulting source looks. It comes with a template
"editor" - though my suggestion is to create the source in an actual
editor and then paste it into the template, and _then_ prompt the source
to add in variables (e.g. field name, file name).
I'm not an SQL expert, but I don't think you can return a "result set"
with RPG code. However it can return an array and a separate parameter
with the number of elements. In regard to the utility, you're welcome
to create a template(s) so this feature is available whenever you create
a source - or simply add it in after the fact.
One thing you need to be aware/careful of is file positioning. In a
basic module, if you access one file in multiple places, you need to
make sure you don't mess up the file positioning, right? Well, if a
file is encapsulated in a service program you need to share that concern
as well. Even more so as some other procedure you may be calling could
also call the file encapsulated service program... I'm going to put some
thought on that.
Kurt Anderson
Application Developer
Highsmith
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
GKern@xxxxxxxxxxxxxxxx
Sent: Wednesday, September 10, 2008 9:37 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: File Encapsulation for use with SQL Stored Procedures
I'm looking for code examples/templates, web articles, or a utility that
will allow me to define database files so that I can access them via SQL
stored procedures. My goal is to bring proof of concept to management
that we can serve our database data with tools other than the 5250 green
screen.
The basic need would be to enable simple I/O stuff such as read, add,
update and delete, and also be able return x number of records to fill a
subfile or a data grid for a browser or windows .net app. Obviously this
would preferable as a service program.
I did follow the thread last week regarding Kurt Anderson's solicitation
for testers for his utility and requested to be included.
Are there any other considerations I should be aware of?
Regards, Jerry
Gerald Kern - MIS Project Leader
Lotus Notes/Domino Administrator
IBM Certified RPG IV Developer
The Toledo Clinic, Inc.
4235 Secor Road
Toledo, OH 43623-4299
Phone 419-479-5535
gkern@xxxxxxxxxxxxxxxx
This e-mail message, including any attachments, is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please inform the
sender by reply e-mail and destroy this and all copies of this message.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.