Having been at the email writing for a few years and having had at least one boss tell me that they stop reading my emails after the first sentence, I'm a little leery of being too wordy to start off with. If someone (like you and others here) need more information, I'm happy to oblige. For others, they can stop reading as soon as their eyes close from boredom.
One problem I have is that RDi is relatively new for me, especially using it for scripting SQL. I'm getting pretty good at coding RPG though. I'm still a little weak on using it to emulate a 5250 session (iSphere is a great tool too.)
Having said that, my original issue is that I don't know all of what RDi connections can do when using SQL. From what I am learning here, the functionality is not there and it's not something that I just don't understand how to do. But I'm just using a single type of connection among several options available (apparently). But those connections are databases (as far as I can tell).
And even if they are restricted to a database, can a single SQL for a DB2 connection be crossed with one for JDBC or any other? If so, how? I don't know what tool would be able to do that, perhaps System i Nav? Now I'm probably REALLY showing my ignorance.
If SQL can read a record as text, then the record text can be sub stringed and manipulated easily enough to INSERT it into named fields of another database. Example:
INSERT INTO TESTLIB/MYFILE (COD, DESCP) SELECT substr(f1,7,7), substr(f1,17,60) FROM mytextfile WHERE substr(f1,15,1) = '1'
The above example is similar to what was used to actually populate the database after the file was transferred to our system.
If mytextfile could be a text file on another system, such as a PC network, and I could point to it as easily (so to speak) as above, then it would have been one SQL statement. Not a "transfer into the first database and then SQL statement into another database".
duane
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Tuesday, August 30, 2016 3:01 PM
To: Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries <wdsci-l@xxxxxxxxxxxx>
Subject: Re: [WDSCI-L] Making the most, or over-thinking it - SQL for uploads
On Tue, Aug 30, 2016 at 1:40 PM, Duane Scott <dscott@xxxxxxxxxxx> wrote:
John, you caught me. I'm often way too wordy, at least that's what I'm told by everybody else.
I actually didn't think you were too wordy. If anything, you weren't wordy enough, because I kept not finding the words I was looking for.
;) But I think the problem was mostly gaps in my own understanding.
Buck filled in one of them, which is: Can RDi be used as an SQL script interpreter? The answer is "yes", which makes sense to me. (I am not an RDi user, if you couldn't tell.)
One of the remaining holes is: How do you use SQL to "work with text files"?
Now, my SQL is pretty rudimentary, so I am very open to the possibility that there are SQL facilities that I am not aware of.
Right now, I don't know how SQL opens or reads text files. As far as I know, SQL only works in the context of data that's already in a database.
Is this your question too? Are you saying that you already know how to
(1) import text data into a database, and then (2) from there, use SQL to work with it; and now you are trying to combine those two steps somehow?
If so, then unless someone swoops in with the magic (and probably kind of new) SQL feature I'm not aware of, then yeah, that bubble is burst.
But...
I've been using SQL for a number of years, mostly interactively on the IBM i and in the last few years within RPG as embedded SQL. I am a big fan. I am also a big fan of doing things simply, meaning the less steps the better.
RPG with embedded SQL is a great tool. You can get the same kind of thing and more with Python (or a number of other languages, but Python is the one I know best, and the one I believe most people would find easiest to learn). The same Python program can read text files directly and easily from your PC and issue SQL commands to be executed on the i. I do it all the time. (It can also read Excel files directly, and that would actually be even simpler.)
Python is a powerful one-stop shop. And you might be able to use it from RDi, I'm not completely sure. Buck may be able to comment on that.
John Y.
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/wdsci-l.
________________________________
________________________________
CONFIDENTIALITY NOTICE: This electronic message transmission is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. If you have received this transmission, but are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this information is strictly prohibited. If you have received this e-mail in error, please contact NALC Health Benefit Plan at 703-729-4677 and delete and destroy the original message and all copies.
As an Amazon Associate we earn from qualifying purchases.