Search This Blog

Monday, May 6, 2013

Using %ExecuteEdits in SQL

A handy tip.

Insert Example:
INSERT INTO PS_MY_ERROR_TABLE SELECT %Bind(PROCESS_INSTANCE) ,'Staging Table' ,'MY_STAGING_TABLE' , A.EMPLID,'Execute Edits Failed' FROM MY_STAGING_TABLE A WHERE %ExecuteEdits(%EDIT_REQUIRED + %EDIT_PROMPTTABLE + %EDIT_TRANSLATETABLE + %Edit_YesNo, MY_STAGING_TABLE)

Update Example:
UPDATE MY_STAGING_TABLE A2 SET A2.ERROR_FLAG = 'Y' WHERE %ExecuteEdits(%EDIT_REQUIRED + %EDIT_PROMPTTABLE + %EDIT_TRANSLATETABLE + %Edit_YesNo, MY_STAGING_TABLE)

No comments:

Post a Comment