[RDMLX]Refer both server database and local database

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

[RDMLX]Refer both server database and local database

Post by MegumiSawada »

Hi,

The customer would like to create a online formview which acheive the following requirements:
Step1. The user enter a code
Step2. The program refer Product master which is on IBM i and check if the entered code is exist in th master
Step3. If Yes, then the program refer Local Database table which is on device and check if the entered code is NOT exist.
Step4: if the code is not exist in the Local Database table, insert a row with entered code to Local Database table.

Note that Local Database table is not the same as Product master on IBM i.

Is it possible to implement this? If yes, how can we acheive this?

I appreciate your kind advice.

Best Regards,
Megumi Sawada
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: [RDMLX]Refer both server database and local database

Post by tsupartono »

Hi Megumi,
You can just always send the selected Product details to the client, regardless of whether it is available or not on the client. If the product is already available on the client, LongRange will just replace the existing row in the table with the new information (provided that you have defined properly a primary key for the Product table).

So the sequence of events would be like this:
- The user enters a code and touch a submit button
- The RDML program runs, and gets the details of the submitted product code.
- It sends the product fields (as Db.XXXX) to the client.
- The clients either add or update the product rows in the local database table (make sure the table has a primary key defined).
Post Reply