BEGIN;
DELETE FROM dsm_apiparams USING dsm_api WHERE api = dsm_api.id AND api.service = :dsId;
DELETE FROM api WHERE service = :dsId;
DELETE FROM dsm_service_organization WHERE service = :dsId;
DELETE FROM dsm_servicepids WHERE service = :dsId;
DELETE FROM dsm_services WHERE id = :dsId;
COMMIT;