Submitted by Syd Nicholson on Mon, 06/22/2009 - 00:00
Forums

I have a question/suggestion.

My requirement is as follows:

I am creating a feature that lists programs and their authorised users. This list will be used with the IceBreak Exit program.
There are two types of users – real i5/OS users and “Virtual Users”. Virtual users have their userIDs and passwords stored in a file.
In the browser I want to display the list of users that have not been authorised to a specific program. In the case of Virtual Users this is a straight forward Exception Join SQL
However, in the case of i5/OS users this is not so straight forward. The method is as follows:

1. List users to ILOB with QUSLOBJ
2. For each user in the list we need an query to determine if the user is present the authorised list, if so, this user information is NOT sent to the browser. This means we need to run a query for each user in the list.
3. Result, the browser only displays users that have not been authorised.

Running a query for each user on the system is not very efficient and could result in very slow response times. So – there are two other ways to handle this:

1. Don’t use SQL – use SETLL instead to determine if a record exists, or
2. Do a single query (using a cursor) and dump all authority records into an ILOB. The ILOB can then be searched for each user entry processed.

So – my question is – to avoid re-inventing any wheels – Is there an IceBreak function that accepts an SQL string and returns the result of the query in an ILOB. – if so, do you have any examples?

Regards
Syd

Niels Liisberg

Mon, 06/22/2009 - 00:00

Hi syd;

It is very easy to place an SQL resultset directly in an ILOB. Since you can redirect the response object to an ILOB and IceBreak SQL always places the result in the response object - Voila... you are golden.

Let me give you an example: Let's say we want to produce a XML as a result of a webservice call. The sql command is received from the client. and the resultset is returned as an XML and placed in the response object along with the rest of the SOAP stuff

 
 
 

I would be looking to read the actual data records from the ILOB instead of decoding XML or JSON.

The data records can be moved into a data structure to obtain the data in the fields.

However, to read the data one need to know how many records there are, the offset to the first record and length of each record.

Can this be achieved?

Syd