Use nested List in Flex server-side SQL (Ibatis)

Source: Internet
Author: User

The Iterate label of Ibatis can be used to traverse every element of the List cyclically to form an SQL file dynamically. But how can I use Iterate to traverse a nested List, after a lot of experiments, I finally found this method. The Code is as follows:

  1. <Iterate Property="CsvData">
  2. Insert into $ dbname $. K_XXX (CD, KNO, MSNO, data_no
  3. <Iterate Property="EntryMsItem" Close=")">
  4. , $ EntryMsItem [] $
  5. </Iterate>
  6. SELECT # Cd #, # kno #, # msNo #, ZEROIFNULL (MAX (DATA_NO) + 1
  7. <Iterate Property="CsvData []" >
  8. , # CsvData []. [] #
  9. </Iterate>
  10. FROM $ dbname $. K_XXX
  11. WHERECD= # Cd #
  12. ANDKNO= # Kno #
  13. ANDMSNO= # MsNo #
  14. ;
  15. </Iterate>
In the above Code, csvData is a nested List, that is, its content is still a List,

The important points of Iterate traversal methods are as follows:

  1. <Iterate Property="CsvData []" >
  2. , # CsvData []. [] #
  3. </Iterate>
CsvData [] indicates an element of the List, while # csvData []. [] # indicates an element of the List.

In this way, a List object with two layers can be traversed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.