Commit fa8d3959 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use REPLACE instead of DELETE and INSERT.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4224 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9a0ecaa7
......@@ -27,17 +27,7 @@ modified
review_state
summary
</params>
DELETE FROM
compatibility
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO
REPLACE INTO
compatibility
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
......
......@@ -20,16 +20,6 @@ getStartDateRangeMax
getStopDate
getStopDateRangeMin
getStopDateRangeMax</params>
DELETE FROM
delivery
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let delivery_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isDelivery[loop_item]">
......@@ -37,7 +27,7 @@ WHERE
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(delivery_list) > 0">
INSERT INTO
REPLACE INTO
delivery
VALUES
<dtml-in prefix="loop" expr="delivery_list">
......
......@@ -15,16 +15,6 @@ getDestinationSectionUid
getResourceUid
getVariationText
getAggregateUidList</params>
DELETE FROM
item
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item] and getAggregateUidList[loop_item]">
......@@ -32,7 +22,7 @@ WHERE
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(movement_list) > 0">
INSERT INTO
REPLACE INTO
item
VALUES
<dtml-in prefix="loop" expr="movement_list">
......
......@@ -10,17 +10,7 @@ class_file:
<params>uid
isMovement
getCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES
REPLACE INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getCategoryList[loop_item]">
......
......@@ -22,16 +22,6 @@ isOrderable
isDeliverable
isDivergent
getVariationText</params>
DELETE FROM
movement
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]">
......@@ -39,7 +29,7 @@ WHERE
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(movement_list) > 0">
INSERT INTO
REPLACE INTO
movement
VALUES
<dtml-in prefix="loop" expr="movement_list">
......
......@@ -9,17 +9,7 @@ class_file:
</dtml-comment>
<params>uid
getAcquiredCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES
REPLACE INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getAcquiredCategoryList[loop_item]">
......
......@@ -34,17 +34,7 @@ getStringIndex
getIntIndex
getFloatIndex
hasCellContent</params>
DELETE FROM
catalog
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO
REPLACE INTO
catalog
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
......
......@@ -10,16 +10,6 @@ class_file:
<params>uid
predicate_property_dict
isPredicate</params>
DELETE FROM
predicate_category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]">
......@@ -27,7 +17,7 @@ WHERE
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(predicate_list) > 0">
INSERT INTO predicate_category VALUES
REPLACE INTO predicate_category VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')">
......
......@@ -10,16 +10,6 @@ class_file:
<params>uid
isPredicate
predicate_property_dict</params>
DELETE FROM
predicate
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]">
......@@ -27,7 +17,7 @@ WHERE
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(predicate_list) > 0">
INSERT INTO predicate VALUES
REPLACE INTO predicate VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
......
......@@ -28,16 +28,6 @@ getStopDate
isAccountable
getPortalType
getVariationText</params>
DELETE FROM
stock
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]">
......@@ -55,7 +45,7 @@ WHERE
</dtml-in>
<dtml-if "row_list">
INSERT INTO
REPLACE INTO
stock
VALUES
<dtml-in prefix="row" expr="row_list">
......
......@@ -9,17 +9,7 @@ class_file:
</dtml-comment>
<params>Subject
uid</params>
DELETE FROM
subject
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO subject VALUES
REPLACE INTO subject VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-let subject="Subject[loop_item]">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment