Oracle BULK INSERT, batch modification, and multiple set of conditional queries in XML

Source: Internet
Author: User
Tags bulk insert cdata

Recently, the company used Ibatis development projects, can use stored procedures to deal with bulk inserts, batch modification and multiple sets of conditional query; But since the use of modules is relatively small, temporarily in the XML configuration, has not done in the XML similar processing, it is necessary to record; Okay, here's the code:

<!--BULK Insert -        <InsertID= "Savenotificationpushinfo"Parameterclass= "Java.util.List">            <! [Cdata[INSERT All]]>                <Iterateconjunction="" >Into notification_push_info (Push_log_no, Business_book,                     employee_id, Notification_no, Push_flag, Push_time ) VALUES (bep_seq_package.fetch_seq (' Notification_push_info ', ' PU                    Sh_log_no ', ' bepdata '), #list [].businessbook:varchar#, #list [].employeeid:varchar#, #list [].notificationno:varchar#, #list [].pushflag:varchar#, Sysdat e)</Iterate>            <! [Cdata[SELECT * from dual]]>        </Insert>                <!--multiple sets of conditional queries -        <SelectID= "Getsamenotificationlist"Parameterclass= "Java.util.List"ResultClass= "Java.util.HashMap">SELECT DISTINCT employee_id "EmployeeId", Notification_no "Notificatio NNo "from Notification_push_info npi where npi.invalid_flag = ' N '<Iterateconjunction= "or"Open= "and"Close="">npi.employee_id = #notiList [].employeeid# and Npi.business_book = #notiList [].b usinessbook# and npi.notification_no = #notiList [].notificationno#</Iterate>        </Select>        <!--Batch Modification -        <UpdateID= "Updatenotilist"Parameterclass= "Java.util.List">begin<Iterateconjunction="">Update notification_push_info Set push_flag = #list []. flag#, push_time = sysdate where Invalid_flag = ' N ' and employee_id = #list [             ].employeeid# and notification_no = #notiList [].notificationno#; </Iterate>end; </Update>

If you have any questions, please point out, thank you!

Oracle BULK INSERT, batch modification, and multiple set of conditional queries in XML

Related Article

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.