Skip to Content
avatar image
Former Member

How to Limit number of records fetched from Oracledb using jdbc adapter

Sender JDBC adapter is configured to fetch data from Oracle DB tables and sent to different MQ queues using JMS receiver adapter based on some identifier from the tables. Now when the adapter polls it fetches multiple rows/records in a single message.

In this scenario each and every row in the table contains a identifier field which determines the destination.Dynamic routing is configured in PI Mapping and value mapping is used to fetch the corresponding MQ Queue.

During testing we found an issue, if a message with two different identifiers is processed then the dynamic routing to corresponding queues is not happening. In this case both messages are going to same queue.

If a messages has multiple rows/records with same identifier then it works. but the above scenario doesn't work.

Is it possible to make the sender adapter to fetch one row at a time from Oracle db.If yes please describe the configs.

Is there any other option available to solve this.?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 01, 2017 at 05:28 AM

    Vini,

    You can use ROWNUM function in your sql statment. Just google this function you will find a lots of example on this.

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

    • Hi

      The below query will fetch all the records from Table2 corresponding to the primary key of Table1 in where condition. (Table1 primary key is a foreign key in Table2)

      select Table2.* from Table1 INNER JOIN Table2 on Table1.Col1 = Table2.Col1 where Table1.Col1 = 1;

      Regards,

      Prithviraj