This function offers the alternative of insertion of a regsiter in case of not found the register to upload. First it tries to uploas the register and if it can not do it, it proceed to execute the sentence of insertion defined.

1 update-or-insert

<update-or-insert>
    <update /> !
    <insert /> !
</update-or-insert>
Example

Insert registers in a table.

Copy
<xsql-script name='test_update_or_insert'>
  <body>
    <println>
        <update-or-insert>
            <update table="aeo_person">
                <column name="nom">Marcos</column>
                <where>
                    persid=5
                </where>
            </update>
            <insert table="aeo_person">
                <column name="persid">4</column>
                <column name="name">Jose</column>
                <column name="surnames">Padilla</column>
                <column name="birth_date">03-12-1986</column>
                <column name="works">0</column>
            </insert>
        </update-or-insert>  
    </println>
  </body>
</xsql-script>

It is about updating the column name in the table aeo_persona, if the uploading issuccessfully it leaves the function, otherwise it proceed to perform the insert of the followed data.