Index: openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 +++ openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql 16 Feb 2002 23:32:06 -0000 1.3 @@ -1,36 +1,33 @@ - postgresql7.1 + postgresql7.1 - - + + insert into ec_orders - (order_id, user_session_id, order_state, in_basket_date) - select :order_id, :user_session_id, 'in_basket', current_timestamp - where not exists (select 1 from ec_orders where user_session_id=:user_session_id and order_state='in_basket') - - - + (order_id, user_session_id, order_state, in_basket_date) + select :order_id, :user_session_id, 'in_basket', current_timestamp + where not exists (select 1 from ec_orders where user_session_id=:user_session_id and order_state='in_basket') + + - - + + insert into ec_problems_log - (problem_id, problem_date, problem_details) - values - (ec_problem_id_sequence.nextval, current_timestamp,:errormsg) - - - + (problem_id, problem_date, problem_details) + values + (ec_problem_id_sequence.nextval, current_timestamp,:errormsg) + + - - + + insert into ec_items -(item_id, product_id, color_choice, size_choice, style_choice, order_id, in_cart_date) -(select ec_item_id_sequence.nextval, :product_id, :color_choice, :size_choice, :style_choice, :order_id, current_timestamp - where not exists (select 1 from ec_items where order_id=:order_id and product_id=:product_id and color_choice [ec_decode $color_choice "" "is null" "= :color_choice"] and size_choice [ec_decode $size_choice "" "is null" "= :size_choice"] and style_choice [ec_decode $style_choice "" "is null" "= :style_choice"])) - - - + (item_id, product_id, color_choice, size_choice, style_choice, order_id, in_cart_date) + (select ec_item_id_sequence.nextval, :product_id, :color_choice, :size_choice, :style_choice, :order_id, current_timestamp + where not exists (select 1 from ec_items where order_id=:order_id and product_id=:product_id and color_choice [ec_decode $color_choice "" "is null" "= :color_choice"] and size_choice [ec_decode $size_choice "" "is null" "= :size_choice"] and style_choice [ec_decode $style_choice "" "is null" "= :style_choice"] and (date_part('epoch', now()) - date_part('epoch', in_cart_date) < 5))) + +