If you customize the order number format for your Magento installation to contain non-numeric characters you may experience the following behaviour: After an order was placed Magento is not able to retrieve a 'fresh' order number and report something like:
'Zend_Db_Statement_Exception' with message 'SQLSTATE: Integrity constraint violation: 1062 Duplicate entry 'MY-ORDER-001337' for key 'UNQ_SK24_SALES_FLAT_ORDER_INCREMENT_ID'' in /.../Zend/Db/Statement/Pdo.php:234
This is a bug in Magentos way to retrieve a new order number. To get rid of it just create a local copy of
$bind = array(':increment_id' => (int)$orderIncrementId);
$bind = array(':increment_id' => $orderIncrementId);
This way Magento is not trying to perform an integer type cast on your non-numeric order id.