cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC restrict table entries

Former Member
0 Kudos

Hi Experts,

How can I limit reading of JDBC sender adapter for DB so that it will read 500 records in each poll.

Normally we use following SQL statement with success in MSSQL Server

Select top 500 * from [NOVASTOCK].[dbo].[CUSTOMER] where STATUS = '0' and TRANSACTION_DATE between'2012-01-02 00:00:00.001'and'2012-02-01 23:59:55.999'

in JDBC Sender ADAPTER i use the same syntax but i can't pull data. 

Thanks

PM

Accepted Solutions (0)

Answers (4)

Answers (4)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Few cents. You need to create a field like column name status_changed and type char(1) like that in the table. 

Select TOP 1000  fieldnames  from  tablename etc.... where status_changed = 0  and some conditions....

Update Top 1000  set status_changed =1  where conditions.....

This should work.  If this is not working, then pay attention  to you update statement and see what it does. Also make sure the autocommit is set on in db level . YOu might also want to set isolation level in adapter accordingly (strongest) and so that some other applications or requests not override your update changes.

Former Member
0 Kudos

Hello,

Ideally, select top*** statement should work with SQL DB, may be u can refer below blog:

http://scn.sap.com/people/dheeraj.kumar5/blog/2010/04/12/pixi-sender-jdbc-select-query-and-update-qu...

Thanks

Amit Srivastava

ambrish_mishra
Active Contributor
0 Kudos

Also take a look at Option 3 in Thread http://scn.sap.com/thread/3407228

cheers

ambrish_mishra
Active Contributor
0 Kudos

Hi Peter,

I don't think you can have a select statement in adapter with date range static.

Why don't you simply try to read the data based on Status.

cheers,

Ambrish