select creditcard_id, user_id
from ec_orders
where order_id=:order_id
update ec_orders
set order_state='in_basket', confirmed_date=null
where order_id=:order_id
update ec_creditcards
set failed_p='t'
where creditcard_id=:creditcard_id
select max(transaction_id)
from ec_financial_transactions
where order_id=:order_id
update ec_orders
set order_state='in_basket', confirmed_date=null
where order_id=:order_id
update ec_items
set item_state = 'shipped', shipment_id = :shipment_id
from ec_products p
where ec_items.order_id = :order_id
and ec_items.product_id = p.product_id
and p.no_shipping_avail_p = 't'
update ec_items
set item_state = 'to_be_shipped'
from ec_products p
where ec_items.order_id = :order_id
and ec_items.product_id = p.product_id
and p.no_shipping_avail_p = 'f'
select user_id
from ec_orders
where order_id=:order_id
update ec_orders
set order_state='in_basket', confirmed_date=null
where order_id=:order_id