Skip to Content
author's profile photo Former Member
Former Member

SQL Statement

Hi,

Please let me know the sql syntax for retrieving one record at a time.

As we use IDOC mapping, we require one idoc per record.

Regards,

B.Anandh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 11:43 AM

    Hi,

    My actual code is

    select * from test where processed ! = 'X'.

    Here it fetches multiple records. Here i wanted it to fetch one record at atime.

    I also have a update statement which updates the flag as processed.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 11:54 AM

    Hi jai,

    In my case the name and processed are same. Not to get confused. Please modify the following code of me.

    <b>SELECT XTPRON,XTREF1,XTREF2,XTCHG1,XTCHG2,XTPROC FROM NEX WHERE XTPROC = 'N';</b>

    Please let me know.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 11:39 AM

    You can use min operator to do that. For ex. select * from jai_tab where name = (select min(name) from jai_tab where status = 0)

    Herejai_tab is the table name, name is a column name in the table and status is a column that acts as indicator to prevent repeated processing of the same record.

    Regards,

    Jai Shankar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 12:26 PM

    Hi guys,

    The code gave an error. Finally we ended with

    Select top 1 from table.

    Though it is a temporary solution, please let me know for any other suggestions

    Regards,

    B.Anandh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 12:37 PM

    Hi guys,

    It is working fine......

    Some typographical error.......:)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.