QuestionQ354

Develop and test code

You are a Dynamics 365 Finance developer.

You have a table named FMVehicle that contains a field named VehicleId. The table has an index named VehicleIdIdx on the VehicleId field. You declare a table buffer named vehicle to reference the table.

You need to select every record from the FMVehicle table into the vehicle variable in ascending order by the VehicleId field.

Which embedded-SQL statement should you use?

  • A select VehicleId from vehicle order by VehicleId asc;
  • B select vehicle index VehicleId;
  • C select vehicle order by VehicleIdIdx desc;
  • D select vehicle index VehicleIdIdx;
Explanation

In X++ embedded SQL, index VehicleIdIdx specifies the table index used for selection. Because VehicleIdIdx is indexed on VehicleId, its normal index order returns the buffer records in ascending VehicleId order. Selecting the vehicle buffer also retrieves the table record rather than projecting only a single field.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!