|
The only concern at V5R4 with returning a result set is that the Array can
only be so big. At 6.1 I think it goes to 16MB - Probably won't every
have an array that big to return data, and if you do, a redesign is
probably in order. That is why I mention the pagination, plus performance
are large data sets for any reason is slower...
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
Michael Ryan <michaelrtr@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
11/30/2010 11:57 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Re: Best Practice for Returning Multiple Rows from RPG to PHP
Thanks Bryce...the stored procedure looks straightforward, and I've done
them before, though not returning a result set.
On Tue, Nov 30, 2010 at 11:43 AM, Bryce Martin <BMartin@xxxxxxxxxxxx>
wrote:
Michael,a
I would use the Stored Procedure. You don't need to know the number of
rows to return, you just need a maximum size for your array that will
accomodate the data being returned. How many possible rows are you
returning? If you are returning A LOT of rows maybe you should look at
pagination and design your procedures to handle this by passing From/To
index numbers and returning set sizes of data (10, 100, etc records) at
time.and
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
Michael Ryan <michaelrtr@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
11/30/2010 09:52 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Best Practice for Returning Multiple Rows from RPG to PHP
Ok...here's what I really want to know.
What is the best option for returning multiple rows of data from RPG to
PHP?
Here's some of my considerations:
* I don't want to do complex processing in my PHP script; I'd rather use
the
PHP to access and display data;
* The RPG program is needed because I'll be accessing multiple tables
could be doing some complex processing;(INSERT)
* I need to return 1-n rows of data.
* I'm on V5R4.
When I look at a stored procedure, I see that I can return a result set.
However, I think I need to have an array or a multiple occurrence DS,
which
makes me think I would need to know how many rows I would return. I was
thinking about a UDTF. Would that mean my RPG program would write
records to the UDTF and then my PHP script would just do a simpleSELECT?
Does a global temporary table play in this?use
I appreciate the insight. Thanks!
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--- This message (including any attachments) is intended only for the
of the individual or entity to which it is addressed and may containand
information that is non-public, proprietary, privileged, confidential,
exempt from disclosure under applicable law. If you are not the intendedIf
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited.
you have received this communication in error, please notify us anddestroy
this message immediately. ---list
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--- This message (including any attachments) is intended only for the use
of the individual or entity to which it is addressed and may contain
information that is non-public, proprietary, privileged, confidential, and
exempt from disclosure under applicable law. If you are not the intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited. If
you have received this communication in error, please notify us and destroy
this message immediately. ---
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.