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



As long as you clear the file every time you shouldn't need to worry about which job's QTEMP is being used.

We did discuss using a global file but then you would have to pass in some sort of session data so you could make the records for each request unique. There's also the question of clean up.

I've never used UDTFs so I can't answer whether they will meet your requirements.

Glenn

On 11/30/2010 11:51 AM, Michael Ryan wrote:
Thanks Glenn...that's what I want to do. Do you know what job's QTEMP is
used? Do you know if a global temporary table would/could perform the same
function? Would a UDTF work in this scenario?

On Tue, Nov 30, 2010 at 11:26 AM, Glenn Hopwood<ghopwood.list@xxxxxxxxx>wrote:

We've recently come across the same issue when trying to get some
complex data into Webquery. We solved it by creating an RPG stored
procedure that creates a temporary table in QTEMP and then returns a
result set over that table.

Below are the steps we took...
- create a table that contains the data points we want to return to
Webquery/PHP.
- create the programs required to create and populate the table in QTEMP.
- After the table is created, open a cursor over it and end the program
with the cursor still open. (Make sure the cursor is defined as 'with
return to client' and we also have a statement that reads 'set result
sets cursor<name of cursor>')
- create the stored procedure over your RPG program.

Glenn

On 11/30/2010 9:52 AM, Michael Ryan wrote:
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 and
could be doing some complex processing;
* 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
(INSERT)
records to the UDTF and then my PHP script would just do a simple SELECT?
Does a global temporary table play in this?

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.




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.