11.09.2007, 05:42 | #1 |
Участник
|
Issues concerning X++: SQL improvements in the next version of Dynamics AX
Источник: http://blogs.msdn.com/x/archive/2007...t-version.aspx
============== I'd like to share with you a description of some of the features that we've finished for the next release. The features described in this blog post are improvements and additions to the X++ data access statements. One deals with ordering and grouping data, another expands the possibilities of the update statement by allowing join clauses; The third feature involves allowing values (or more precisely, constants that are not field related) into the selection that is inserted into a table in an insert_recordset statement. Ordering and grouping Data Previously, the order by and group by clauses acted on the table in the current join or select clause. So, the following X++: 1: CustTable ct; 2: CustTrans transactions; 3: 4: select * from ct order by AccountNum 5: join transactions order by AmountCur 6: where ct.AccountNum == transactions.AccountNum; X++: 1: select * from ct 2: join transactions 3: order by transactions.AmountCur, ct.AccountNum 4: where ct.AccountNum == transactions.AccountNum; Improvements to the update statement The update statement may now have a join clause attached to it, as shown in the code snippet below: X++: 1: // Three Table Join 2: update_recordset salestable 3: setting currencycode = 'USD' 4: join custtable 5: where custtable.accountnum = salesTable.custaccount 6: join custgroup 7: where custgroup.name == 'Retail' && custgroup.custgroup == custTable.custgroup; The Insert statement. The insert statement is generally used to insert data from one table into another. The programmer typically writes a selection of fields matching the fields to insert into the target table and delimits the data by using suitable where and join clauses: X++: 1: insert_recordset MyTargetTable(targetField1, targetField2) 2: select sourceField1, sourceField2 from MySourceTable where ... 3: How does this feature work? Consider the case where a company has decided to make it mandatory for all customers in Italy to have a credit limit. Isaac would write: X++: 1: Boolean mandatory = true; 2: CustTable custTable; 3: insert_recordset CustTable (MandatoryCreditLimit) 4: select mandatory from CustTable where CustTable.Countryname == "Italy"; Источник: http://blogs.msdn.com/x/archive/2007...t-version.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|