Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TABLE: ORDER_LOCK
- Name Null Type
- ---------------------- -------- ----------
- ORDER_ID NOT NULL NUMBER(10) [PRIMARY KEY]
- ORDER_REF_ID NUMBER(10) [UNIQUE KEY]
- ORDER_MSG_SENT NUMBER(1)
- merge into ORDER_LOCK al
- using ( select ? ORDER_REF_ID, ? ORDER_MSG_SENT from dual ) t
- on (al.ORDER_REF_ID = t.ORDER_REF_ID)
- when not matched then
- insert (ORDER_ID, ORDER_REF_ID, ORDER_MSG_SENT)
- values (ORDER_LOCK_SEQ.nextval, t.ORDER_REF_ID, t.ORDER_MSG_SENT)
- merge into ORDER_LOCK al
- using ( select 1 ORDER_REF_ID, sysdate ORDER_MSG_SENT from dual ) t
- on (al.ORDER_REF_ID = t.ORDER_REF_ID)
- when not matched then
- insert (ORDER_ID, ORDER_REF_ID, ORDER_MSG_SENT)
- values (ORDER_LOCK_SEQ.nextval, t.ORDER_REF_ID, t.ORDER_MSG_SENT);
- merge into ORDER_LOCK al
- using ( select 1 ORDER_REF_ID, sysdate ORDER_MSG_SENT from dual ) t
- on (al.ORDER_REF_ID = t.ORDER_REF_ID)
- when not matched then
- insert (ORDER_ID, ORDER_REF_ID, ORDER_MSG_SENT)
- values (ORDER_LOCK_SEQ.nextval, t.ORDER_REF_ID, t.ORDER_MSG_SENT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement