web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Qbds or while select in table

(0) ShareShare
ReportReport
Posted on by 30

Dear All,

Can you please let me know if i select table "LedgerTrans" like

1. While select ledgerTrans
    where ...  // put range

2. If i use QueryBuildDataSource to select LedgerTrans and pur Range

Then what actually happened in Particular table.
Please give me more shed on this.
Thanks!
Arpan Sen

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,231 Super User 2025 Season 2 on at

    Hi Arpan,

    There is no real difference in fetching the records. Both ways will be translated into SQL statements handled by the AX kernel.

    It is a choice to use one of both methods.

  • @rp@n Profile Picture
    30 on at

    Thanks Andre,

  • Martin Dráb Profile Picture
    237,994 Most Valuable Professional on at

    @rp@n, don't forget to mark the verified answer.

  • @rp@n Profile Picture
    30 on at

    Hi Andre,

    I know from some one that if i used qbds then it will only select those record based on the condition and if i select while select with condition then it will loop for whole table. So, qbds is much faster than while select.

    Is't correct?

    Thanks!

    Arpan Sen

  • Verified answer
    Martin Dráb Profile Picture
    237,994 Most Valuable Professional on at

    No, that's a nonsense. I think you confuse a while select with a condition:

    while select table1 where table1.Field1 == 1

    with a while select fetching all data without any condition and then ignoring some records in X++:

    while select table1
    {
        if (table1.Field1 == 1) ...
    }

    If you compare the same queries, it will behave the same regardless if you use a select statement or the Query framework.

  • @rp@n Profile Picture
    30 on at

    Thanks a lot Martin

  • @rp@n Profile Picture
    30 on at

    Hi Martin

    I understand properly. Can you please let me know when we need to write qbds or while select in query. because both are behave same right?

    Is there any specific reason to write qbds in code?

    Please suggest me.

    Thanks!

    Arpan Sen

  • Verified answer
    Martin Dráb Profile Picture
    237,994 Most Valuable Professional on at

    There are many reasons. For example, you want to work with an existing query, such as the one generated for form datasource. You want to generate a query dynamically based on business logic (select statemement is obviusly hard-coded and you can't change it as runtime). You want to create a base query and modify it at different places, You want to store the query in database for later use. And so on...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans