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



On 1/21/2016 1:49 PM, Justin Dearing wrote:
On Thu, Jan 21, 2016 at 1:34 PM Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
Personally, I would be fighting and kicking to avoid working with
multi-member files but I feel morally obliged to share how I work with
them.

There is no need for them in modern applications, except for the
partitioning, which of course makes them seemless. However, they exist on
systems, and there is RPG and COBOL calling them. I'd rather be able to
explore them from SQL if that's possible. Naturally I'll likely make
aliases when I need to talk to the third member of file X. However, I just
want to see how close I can get to SELECT * FROM SCHEMA.TABLE(MEMBER).

My last post on this, promise :-)

'Explore from SQL' could mean a lot of things. Mostly, it means that
off the shelf tools are not going to work unless you write a simple sort
of tool to do a bunch of CREATE ALIAS statements.

Many moons ago, I read an article in one of the trade magazines;
probably written by Bob Cozzi, on how to run an SQL statement from the
command line by way of QMQRY. I have a utility that I have been using
on my green screen terminal command line for decades. It's written up
in the wiki: http://wiki.midrange.com/index.php/SQL#SQL_via_QM_Query
The current incarnation handles overrides to a specific member. This
works great for me in my green screen world but it's useless if you want
to query a multi-member file from Java, PHP, ODBC, etc.

If I were to really want to access any given member ad hoc via JDBC, I'd
think about writing a stored procedure or maybe a UDTF that would take
the SQL statement, file and member as parameters, perform the OVRDBF,
PREPARE and EXECUTE the SQL statement and return the results as a result
set / table back to the caller. It's indirect, but I just don't see how
to directly access any given member ad hoc through an interface that
does not support members. Thus, the original idea of a utility to
create (and thinking of cleaning up after myself, drop) ALIASes in advance.


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.