Better yet, where can I find documentation on writing 2E to interact with DDL objects/routines (tables,views,stored procs, etc)?
Quick background...I am an experienced DBA but a NOVICE 2E developer. I am looking to get a deeper understanding of how 2E interacts with the data model (normalized vs. denormalized data, surrogate keys vs. natural keys, etc.) because my company is looking to modernize our AS400, meaning moving toward DDL structures in place of DDS. From my perspective, it seems that if 2E can interact with the data through stored procedures and other abstracted constructs, it will be much easier to modernize in a step-wise fashion. I sincerely hope that this is the case!
Thanks in advance!
UPDATE: I just joined the community and already I'm being irresponsible! Shame on me!
This question has already been posed and responded to...I will consider this discussion closed and will defer to the earlier discussion threads.
If you have any questions related to 2E and DDL, let me know and I'll see if I can help...
As I mentioned earlier, we are currently in the midst of modernizing our AS400. That said, there are several (2E-based) processes currently being done in an iterative fashion that could benefit greatly if done more in a set-based fashion. In a nutshell, I am trying to get an understanding of how 2E could be postured to call a SQL proc that would do the work instead.
In an ideal world, I would expect to find some "Hello World" examples like the following:
A call is made from 2E to a DDL routine and the result(s) return to the code before being presented onscreen (e.g., 2E fires a proc that counts the number of records in a table).
Are you familiar with any?
Hopefully I am being clear with my question.
There is no way to natively interact with stored procedures in 2E. But let's step back before deciding that's what you really want to do.
You note that you have processing that could benefit from set based processing. How do you know it would benefit? What has led you to determine that? I'm not saying that there aren't situations where this is the case, it's just that more often than not, you simply don't gain enough benefits, and waste time and effort for little gain.
Pragmatically, I have found little benefit from a performance perspective to moving from traditional RLA from RPG. The main benefit that I have found in moving to DDL has been external interfaces where, for example, better field names are needed for the users because they are using tooling that presents the fields to them and DDS 6 character field names are meaningless. Sure, there might be benefits to large set based processing (perhaps millions of records), but I have some hefty set sizes, and really don't have an issue with RPG RLA.
It's really difficult to offer much because I really have little idea of your specific application and what languages you are implementing. It might not even be performance that is the perceived issue (see, I really don't know what it is you are trying to fix)...
You can write source code to call stored procedures from 2E functions, but you would have to manage the result sets yourself, and is probably too much work, and little benefit. 2E can also generate SQL database access, rather than RLA, so you might want to look at that, but there are some new performance improvements in SQL that have not been implemented in 2E.
Enough from me...
So much I agree with here Crispin.
Chasing performance is a red-herring in 2015 it was legitimate in 2005 but with all the improvements behind the scenes if you indeed to get performance gains it should be seen as a bonus but not the reason.
"you simply don't gain enough benefits, and waste time and effort for little gain" I agree
“The fact that you use Plex is an additional "complication" in your case, but also a HUGE benefit, as the fundamental approach behind 2E and Plex is "data centricity".” Marinus Van Sandwyk, Founder & Chief Technology Officer on IBM i on Power Systems TEMBO Technology Lab (Pty) Ltd & TEMBO Application Generation (Pty) Ltd. specializes in the development of database modernization solutions for IBM Power Systems running IBM i. http://www.linkedin.com/grp/post/59314-6037855001861242881
A reason in 2015 to move to SQL defined database is to move to a data-centric development approach which no doubt as a DBA LymonZerga had expected to be the case already.
LymonZergaplease read IBM Redbooks | Modernizing IBM i Applications from the Database up to the User Interface and Everything in Between
BUT here is a theory on Record Access:
If one day RLA was not as quick as SQL at a single record basis then you would need to revisit the code to gain the performance but if you use SQL today you take the performance hit today but who knows in the future. But using 2E allows you to switch to SQL access making this point rather mute.
I found the following quote interesting and not frequently mentioned "SQL can use the multi-threading capabilities of the system without causing RPG and COBOL program (which are single-threaded) issues." IBM Redbooks | Modernizing IBM i Applications from the Database up to the User Interface and Everything in Between
First step in your modernizing journey should be referring to the AS400 server to Power Systems server and the 0S400 OS as IBM i
Petty maybe but AS400 was dropped by IBM in 2000....and the IBM i community can be said to suffer from a perception problem which is not helped by the communities use of vernacular. I call it AS400 all the time but I'm trying to stop which is my point.