× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jon,

Isn't SQL doing some dynamic conversion of the retrieved SQL variable into the host variables? Embedded SQL in RPG has some well thought out rules for converting database columns into code variables which works pretty well. Making a change to a database field might require a code change to the host variable but maybe (hopefully) not.

Can you get i5 error handling in PHP? One of the great benefits of using RPG is the system default error handling. You can also get some i5 error handling with SQL if you use RUNSQLSTM but not with embedded SQL. Checking a SQL error code then having to roll my own error handler isn't a good solution with infrastructure built up around the system default error handling.

Has anyone written an RPG utility to throw an error message that could be wrapped around an embedded SQL statement? Anything that would allow (C)ancel, (R)etry, (D)ump options on QSYSOPR for each of the SQL errors? There is a SQL message file out there with all the errors but it doesn't have (C)ancel, etc options in the message text. If no one has done this already this looks like I need to scratch an itch.

Thanks,
Paul Morgan

Principal Programmer Analyst
IT Supply Chain/Replenishment

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Saturday, September 03, 2011 1:33 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Storing Numeric Values in the Database


On Sep 3, 2011, at 1:00 PM, midrange-l-request@xxxxxxxxxxxx wrote:

I don't see why a language cannot support both dynamic and static
typing. in effect, the RPG SQL pre compiler does that with the dynamic
sql that is embedded into the RPG code.

That isn't really what happens if you think about it Steve.

The SQL portion is only dynamic in the sense that the statement can be dynamically built etc. but in order to do anything with the data retrieved within the RPG context you have to associate named pre-defined host variable fields with the results of the queries.

There are languages - PHP for one - on the IBM i that are dynamically typed, why not use those. Of course it is possible to have the RPG compiler modified to handle dynamic typing as well as static but it isn't going to happen in any meaningful timeframe that I can see.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.