Oracel

作者: 垃圾简书_吃枣药丸 | 来源:发表于2021-04-02 14:00 被阅读0次
    • oracel一次查询多个sequence,批量查询sequence
            SELECT SEQ.nextval
            FROM dual
            CONNECT BY ROWNUM <= #{batchSize}
    
    • oracel批量插入-先批量获取sequenceId赋值给主键,再批量插入
        <insert id="batchSave">
            INSERT INTO NOTIFY_BREED(id, notify_id, breed_id)
            <foreach collection="dataSet" open="(" item="item" separator=" union " index="index" close=")">
                SELECT
                #{item.id},
                #{item.notifyId},
                #{item.breedId}
                FROM DUAL
            </foreach>
        </insert>
    

    相关文章

      网友评论

          本文标题:Oracel

          本文链接:https://www.haomeiwen.com/subject/fftqkltx.html