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 ...@@ -27,17 +27,7 @@ modified
review_state review_state
summary summary
</params> </params>
DELETE FROM REPLACE INTO
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
compatibility compatibility
VALUES VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
......
...@@ -20,16 +20,6 @@ getStartDateRangeMax ...@@ -20,16 +20,6 @@ getStartDateRangeMax
getStopDate getStopDate
getStopDateRangeMin getStopDateRangeMin
getStopDateRangeMax</params> 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-let delivery_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isDelivery[loop_item]"> <dtml-if "isDelivery[loop_item]">
...@@ -37,7 +27,7 @@ WHERE ...@@ -37,7 +27,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(delivery_list) > 0"> <dtml-if expr="_.len(delivery_list) > 0">
INSERT INTO REPLACE INTO
delivery delivery
VALUES VALUES
<dtml-in prefix="loop" expr="delivery_list"> <dtml-in prefix="loop" expr="delivery_list">
......
...@@ -15,16 +15,6 @@ getDestinationSectionUid ...@@ -15,16 +15,6 @@ getDestinationSectionUid
getResourceUid getResourceUid
getVariationText getVariationText
getAggregateUidList</params> 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-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item] and getAggregateUidList[loop_item]"> <dtml-if "isMovement[loop_item] and getAggregateUidList[loop_item]">
...@@ -32,7 +22,7 @@ WHERE ...@@ -32,7 +22,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(movement_list) > 0"> <dtml-if expr="_.len(movement_list) > 0">
INSERT INTO REPLACE INTO
item item
VALUES VALUES
<dtml-in prefix="loop" expr="movement_list"> <dtml-in prefix="loop" expr="movement_list">
......
...@@ -10,17 +10,7 @@ class_file: ...@@ -10,17 +10,7 @@ class_file:
<params>uid <params>uid
isMovement isMovement
getCategoryList</params> getCategoryList</params>
DELETE FROM REPLACE INTO category VALUES
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
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getCategoryList[loop_item]"> <dtml-if expr="getCategoryList[loop_item]">
......
...@@ -22,16 +22,6 @@ isOrderable ...@@ -22,16 +22,6 @@ isOrderable
isDeliverable isDeliverable
isDivergent isDivergent
getVariationText</params> 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-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]"> <dtml-if "isMovement[loop_item]">
...@@ -39,7 +29,7 @@ WHERE ...@@ -39,7 +29,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(movement_list) > 0"> <dtml-if expr="_.len(movement_list) > 0">
INSERT INTO REPLACE INTO
movement movement
VALUES VALUES
<dtml-in prefix="loop" expr="movement_list"> <dtml-in prefix="loop" expr="movement_list">
......
...@@ -9,17 +9,7 @@ class_file: ...@@ -9,17 +9,7 @@ class_file:
</dtml-comment> </dtml-comment>
<params>uid <params>uid
getAcquiredCategoryList</params> getAcquiredCategoryList</params>
DELETE FROM REPLACE INTO category VALUES
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
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getAcquiredCategoryList[loop_item]"> <dtml-if expr="getAcquiredCategoryList[loop_item]">
......
...@@ -34,17 +34,7 @@ getStringIndex ...@@ -34,17 +34,7 @@ getStringIndex
getIntIndex getIntIndex
getFloatIndex getFloatIndex
hasCellContent</params> hasCellContent</params>
DELETE FROM REPLACE INTO
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
catalog catalog
VALUES VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
......
...@@ -10,16 +10,6 @@ class_file: ...@@ -10,16 +10,6 @@ class_file:
<params>uid <params>uid
predicate_property_dict predicate_property_dict
isPredicate</params> 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-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]"> <dtml-if "isPredicate[loop_item]">
...@@ -27,7 +17,7 @@ WHERE ...@@ -27,7 +17,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(predicate_list) > 0"> <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-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')"> <dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')">
......
...@@ -10,16 +10,6 @@ class_file: ...@@ -10,16 +10,6 @@ class_file:
<params>uid <params>uid
isPredicate isPredicate
predicate_property_dict</params> 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-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]"> <dtml-if "isPredicate[loop_item]">
...@@ -27,7 +17,7 @@ WHERE ...@@ -27,7 +17,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(predicate_list) > 0"> <dtml-if expr="_.len(predicate_list) > 0">
INSERT INTO predicate VALUES REPLACE INTO predicate VALUES
<dtml-in prefix="loop" expr="predicate_list"> <dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
( (
......
...@@ -28,16 +28,6 @@ getStopDate ...@@ -28,16 +28,6 @@ getStopDate
isAccountable isAccountable
getPortalType getPortalType
getVariationText</params> 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-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]"> <dtml-if "isMovement[loop_item]">
...@@ -55,7 +45,7 @@ WHERE ...@@ -55,7 +45,7 @@ WHERE
</dtml-in> </dtml-in>
<dtml-if "row_list"> <dtml-if "row_list">
INSERT INTO REPLACE INTO
stock stock
VALUES VALUES
<dtml-in prefix="row" expr="row_list"> <dtml-in prefix="row" expr="row_list">
......
...@@ -9,17 +9,7 @@ class_file: ...@@ -9,17 +9,7 @@ class_file:
</dtml-comment> </dtml-comment>
<params>Subject <params>Subject
uid</params> uid</params>
DELETE FROM REPLACE INTO subject VALUES
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
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-let subject="Subject[loop_item]"> <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