Home > X++ stuffs > Difference b/w SELECT AND FIELDSELECT in Dynamics AX

Difference b/w SELECT AND FIELDSELECT in Dynamics AX

 

Hi,  

X++ contains special language feature (i.e. embedded SQL).So we use select query in X++ directly to fetch/retrieve data.

SELECT in Dynamics AX can be distinguished into two types.

·         normal Select

·         field Select

There is a difference between a normal select statement and a field select statement:

field select statement

               normal select statement

This operates directly on a table. So table buffer need not be instantiated.

This operates on a table buffer variable. So table buffer should be instantiated.

Only the particular field is selected from the table.

Whereas in normal select, entire table fields are selected.

SQL statement:

(CustTable) SELECT A.ACCOUNTNUM, A.RECID FROM CUSTTABLE A WHERE (DATAAREAID=?) ORDER BY A.DATAAREAID,A.ACCOUNTNUM [ID=11910, Reused=Yes]

SQL statement:

(CustTable) SELECT TOP 1 A.ACCOUNTNUM,A.NAME,A.ADDRESS,A.PHONE,A.TELEFAX,A.INVOICEACCOUNT,

A.CUSTGROUP,A.LINEDISC,A.PAYMTERMID,A.CASHDISC,A.CURRENCY,

A.INTERCOMPANYAUTOCREATEORDERS,A.SALESGROUP,

A.BLOCKED,A.ONETIMECUSTOMER,A.ACCOUNTSTATEMENT,

A.CREDITMAX,A.MANDATORYCREDITLIMIT,

A.DIMENSION,A.DIMENSION2_,A.DIMENSION3_,A.VENDACCOUNT,

A.TELEX,A.PRICEGROUP,A.MULTILINEDISC,A.ENDDISC,

A.VATNUM,A.COUNTRYREGIONID,A.INVENTLOCATION,

A.DLVTERM,A.DLVMODE,A.MARKUPGROUP,A.CLEARINGPERIOD,

A.ZIPCODE,A.STATE,A.COUNTY,A.URL,A.EMAIL,A.CELLULARPHONE,

A.PHONELOCAL,A.FREIGHTZONE,A.CREDITRATING,A.TAXGROUP,

A.STATISTICSGROUP,A.PAYMMODE,A.COMMISSIONGROUP,

A.BANKACCOUNT,A.PAYMSCHED,A.NAMEALIAS,A.CONTACTPERSONID,

A.INVOICEADDRESS,A.OURACCOUNTNUM,A.SALESPOOLID,A.INCLTAX,

A.CUSTITEMGROUPID,A.NUMBERSEQUENCEGROUP,A.LANGUAGEID,

A.PAYMDAYID,A.LINEOFBUSINESSID,A.DESTINATIONCODEID,

A.GIROTYPE,A.SUPPITEMGROUPID,A.GIROTYPEINTERESTNOTE,

A.TAXLICENSENUM,A.WEBSALESORDERDISPLAY,A.PAYMSPEC,

A.BANKCENTRALBANKPURPOSETEXT,A.BANKCENTRALBANKPURPOSECODE,

A.CITY,A.STREET,A.PAGER,A.SMS,A.INTERCOMPANYALLOWINDIRECTCRE80,

A.PACKMATERIALFEELICENSENUM,A.TAXBORDERNUMBER_FI,

A.EINVOICEEANNUM,A.FISCALCODE,A.DLVREASON,

A.FORECASTDMPINCLUDE,A.GIROTYPECOLLECTIONLETTER,

A.SALESCALENDARID,A.CUSTCLASSIFICATIONID,A.INTERCOMPANYDIRECTDELIVERY,

A.ENTERPRISENUMBER,A.SHIPCARRIERACCOUNT,A.GIROTYPEPROJINVOICE,

A.INVENTSITEID,A.ORDERENTRYDEADLINEGROUPID,A.SHIPCARRIERID,

A.SHIPCARRIERFUELSURCHARGE,A.SHIPCARRIERBLINDSHIPMENT,

A.PARTYTYPE,A.PARTYID,A.SHIPCARRIERACCOUNTCODE,A.PROJPRICEGROUP,

A.GIROTYPEFREETEXTINVOICE,A.SYNCENTITYID,A.SYNCVERSION,A.SALESDISTRICTID,

A.SEGMENTID,A.SUBSEGMENTID,A.RFIDITEMTAGGING,A.RFIDCASETAGGING,

A.RFIDPALLETTAGGING,A.COMPANYCHAINID,A.MAINCONTACTID,A.COMPANYIDSIRET,

A.COMPANYIDNAF,A.IDENTIFICATIONNUMBER,A.PARTYCOUNTRY,A.PARTYSTATE,

A.ORGID,A.PAYMIDTYPE,A.FACTORINGACCOUNT,A.PBACUSTGROUPID,

A.MODIFIEDDATETIME,A.CREATEDDATETIME,A.RECVERSION,

A.RECID, A.MEMO FROM CUSTTABLE A WHERE ((DATAAREAID=?)

AND (ACCOUNTNUM LIKE? ESCAPE ‘\’ )) [ID=11873, Reused=Yes]

 

Example:

Sample job is illustrated above. Have a hAppYyYyYyYyYy dAxzinggggggggg Angel emoticon

Advertisements
Categories: X++ stuffs
  1. Santosh.
    October 29, 2009 at 12:27 pm

    tanky!!! kaaka….

  2. Santosh Kumar
    October 29, 2009 at 12:01 pm

    Good Analysis dear 🙂

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: