Options

FINDFIRST & SETCURRENTKEY

RemcoRemco Member Posts: 81
Do you still need to use SETCURRENTKEY with the FINDFIRST, FINDLAST and FINDSET statement?

Comments

  • markborgesmarkborges Member Posts: 170
    Which version of Navision supports these statements?

    :wink:
    Marcelo Borges
    D365 Business Central Solutions Architect
    BC AL/NAV C/AL Developer
    BC Repositories.com
  • WaldoWaldo Member Posts: 3,412
    On Native: always use it (ISAM)
    On SQL: use SETCURRENTKEY to retrieve the recordset in an ordered way. SQL doesn't use it to fetch the data.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • MbadMbad Member Posts: 344
    Yes and 4.0 SP2+
  • krikikriki Member, Moderator Posts: 9,120
    Remco wrote:
    Do you still need to use SETCURRENTKEY with the FINDFIRST, FINDLAST and FINDSET statement?
    Depends in which order you want the records.
    On SQL, it serves ONLY to define the order.
    On Navision it serves to select the correct key for performance (and also ordering).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • WaldoWaldo Member Posts: 3,412
    so I was right?
    :wink:

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • krikikriki Member, Moderator Posts: 9,120
    Waldo wrote:
    so I was right?
    :wink:
    Yes, I just refrased it :wink:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • RemcoRemco Member Posts: 81
    So, does this mean that with using a FINDFIRST in a batchproces it is of no use to add a SETCURRENTKEY to make this batchproces faster.
  • kinekine Member Posts: 12,562
    You can hint SQL server through SETCURRENTKEY (for example, he can change the execution schema when SQL knows that you want to order the set in some way...).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.