Forum Discussion

VenkataR1's avatar
VenkataR1
New Contributor
5 years ago

How to read unique data in a column through JDBC request without giving conditions

Hi Team, I am using JDBC step for retrieving data in which we use data from a column and use it in another request.But if I use the data from first row it will not be usefull next time if I run the ...
  • richie's avatar
    5 years ago

    Hi VenkataR1 

     

    What's the database vendor? Oracle ? SQL Server? DB2?  there's a number of ways to answer this and some of the answers would be determined by the RDBMS vendor.

     

    Can you please do a describe on the table youre querying so we can get an understanding of the columns that are contained within the table - I'm wondering if there is a primary key that can be indexed.

     

    e.g. - ACC_ID(INT(11)), ACCOUNT_FIRSTNAME(VARCHAR(200)), ACCOUNT_LASTNAME(VARCHAR(200)), PHONE(INT(11))

     

    Can you provide an example of the data contained within each of columns within the table?

     

    e.g. ACC_ID = 12345678901, ACCOUNT_FIRSTNAME = 'Rich', ACCOUNT_LASTNAME = 'JONES', PHONE = 07958 985 111

     

    There's a possibility you can resolve this depending on the data contents of the table and the proprietary RDBMS setup (ROWID, ROWNUM, etc.) that you may be able to handle this by adding a filter on the query you're executing rather than just a simple 'SELECT * FROM TABLE;' hence the reason I'm asking the above questions 

     

     

    Cheers,

     

    Rich