cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrive last record of the data coming from database

former_member203627
Participant
0 Kudos

Hi

I have a scenario where I am getting dataa from oracle table and I need to update the last record which I received from oracle table.

Can you please suggest, how to resolve this issue.

Regards

ria

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member203627
Participant
0 Kudos

Solved

former_member203627
Participant
0 Kudos

Hi

I am already using the following select statement

select * from eair.EAIR_TRX_BODS b, eair.eair_map_params p where b.appl_code_src = 'PRMS' and b.bod_code = 'REQS' and b.trx_pk > p.value and p.concurrent_program_id = 49627 and p.place_holder = '%REQSID_FROM%'

How can I use Max or Min with this statement to get the last record.

Regards

Ria

Former Member
0 Kudos

Refer this link : http://bytes.com/forum/thread583904.html

Better to write and test the querry at database end, once its final as per your requirement then pass that SQL querry in JDBC sender adapter.

Also try to get assistance from Database forums or a database expert

Thanks

Farooq.

Edited by: Farooq Farooqui on Aug 8, 2008 12:31 PM

Former Member
0 Kudos

Hi ria,

with

select *

you select ALL records with fits to the condition.

Use:

select-statement in CC

select min(<yourField>) from <schema><table> where status = 'new'

Update-Statement in CC

update <schema><table> set status = processed

You should have a status field in the database table to flag already processed files

Regards Mario

Former Member
0 Kudos

Hi,

Check the below path for the needed information.

http://help.sap.com/saphelp_nw70/helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm --> Document formats for the Receiver JDBC Adapter.

If useful, points to be given

Regards,

Gunti

Former Member
0 Kudos

Hi,

use

select min

:

Sample:

select min(yourField) from <table> where <otherField> = <specialValue>

alternative you can use

select max

Regards Mario