× 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.



This is a funny discussion, just because we have SQL and DDL that doesn’t
mean that we don’t have RLA and DDS it only means that we have two ways to
access and define the DB.



SQL can be very complex if we start to join a complex structure of files
together and not because it can’t be done by a SQL geek it may also suffer
for lack of performance.



I primarily use SQL in my REST services since I need server side generic
column sort and selections and that would be a nightmare to try to do in
RLA however I use RLA to retrieve additional information from referential
tables.



This approach keeps the SQL rather neat and readable and performance
friendly and I only have to use RLA for additional information when needed.



Besides that I build my RPGLE SQL declarations in sections that are
concatenated into a complete Cmd minimizing the exec SQL statements:



* Declare General Sql Variables

d sqlDs ds

d sqlCmd

d sqlCmdCount

d sqlSelect

d sqlFrom

d sqlWhere

d sqlSearch

d sqlOrder

d sqlSortField

d sqlSortDir

d sqlFor

d sqlCount

d sqlRow

d sqlRows

d sqlStart

d sqlError



Since much of my SQL code is program generated based on templates I end up
with statements like:



sqlSelect =

'select RRN(PXMSTBL) as RRN'

// powerEXT generated source

+',MSFILE'

+',MSFILL'

+',MSFILM'







That then again is converted to JSON by



// powerEXT generated source

jsonNode('*string':'MSFILE':MSFILE);

jsonNode('*string':'MSFILL':MSFILL);

jsonNode('*string':'MSFILM':MSFILM);







On Sat, Oct 25, 2014 at 6:17 AM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Fri, Oct 24, 2014 at 5:56 PM, Vernon Hamberg
<vhamberg@xxxxxxxxxxxxxxx> wrote:
I guess I don't see the push to "native I/O is dead" - although IBM do
seem
to be pushing it hard. For me, this becomes a choice - going with only
one
approach isn't where I'm at, for now anyway.

I really don't know IBM's strategy. I've heard a few folks say IBM
doesn't have a coherent strategy. But I haven't personally felt that
IBM was pushing particularly hard against native I/O.

I hear you [Matt] on the look of things - it seems better now in the
freer format, to some extent. I'm also quite excited at the prospect
of embedding an entire stored procedure in RPG - then most of the
SQL code is really clean - only one /exec sql - and SQL code
makes things pretty easy, compared to what we are used to with,
as you say, so many /EXEC SQL bits.

I actually read Matt's comments as more that the very idea of mixing
SQL with RPG was ugly. Sure, it's even uglier when you have to have
way, way too many "/exec sql" lines, but even without *any* extraneous
lines (assuming a really fancy parser that doesn't need to be told
which lines are SQL), it might feel kind of dirty to folks who like to
think in SQL and program as much as possible in SQL.

And if I've misread Matt, I'm confident that there are others out
there who feel the way I describe above.

I think you and I are not that far apart on the spectrum - slightly
different choices and preferences - seems it's all good. And maybe as the
immortal Tevye would say - "You're both right!"

I certainly won't go on record disagreeing with Tevye!

But my take on embedded SQL is that it's a net win. I'll admit that
my SQL skills are pretty weak. But I do like SQL. I love the ability
to mix SQL with procedural code, because at some point, trying to do
certain things in SQL gets complicated enough that even the experts
have trouble writing it, and what they do manage to come up with is,
at least to those with merely ordinary SQL skills, a big pile of
*declarative* spaghetti.

Oracle has PL/SQL, Microsoft has Transact-SQL; ODBC and JDBC
connections typically involve embedding SQL in procedural code. I
think it's only natural to provide this ability to mix styles, and I
don't think it's solely a crutch for programmers who can't or won't
think purely in SQL.

John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.