Component File &PS_SQLFile; Component File &ESB_SQLFile; Component string &UpdateText; Local string &Correct; Local SQL &SQL; Local boolean &Problems = False; &UpdateText = ""; SQLExec("SELECT 'Y' from USER_OBJECTS O, PS_UO_PLSQL PL where O.OBJECT_TYPE = 'FUNCTION' and O.OBJECT_NAME = :1 and PL.ITEMNAME = :1 and cast( PL.LASTINSTALLED as DATE ) = O.LAST_DDL_TIME and O.STATUS = 'VALID'", UO_PLSQL_AET.ITEMNAME, &Correct); If All(&Correct) And UO_PLSQL_AET.UO_RECREATE_FLAG <> "Y" Then Exit 1; Else If UO_PLSQL_AET.UO_RECREATE_FLAG = "Y" Then MessageBox(0, "", 23001, 7, "Recreating function %1 as specified on the run control", UO_PLSQL_AET.ITEMNAME); UO_PLSQL_AET.AE_APPSTATUS = 1; Else MessageBox(0, "", 23001, 8, "Updating function %1", UO_PLSQL_AET.ITEMNAME); UO_PLSQL_AET.AE_APPSTATUS = 1; End-If; &PS_SQLFile.WriteLine(UO_PLSQL_AET.SQLTEXT); &UpdateText = "Update PS_UO_PLSQL set LASTINSTALLED = ( select LAST_DDL_TIME from USER_OBJECTS where OBJECT_NAME = '" | UO_PLSQL_AET.ITEMNAME | "' and OBJECT_TYPE = 'FUNCTION' ) where ITEM_TYPE = 'F' and ITEMNAME = '" | UO_PLSQL_AET.ITEMNAME | "'"; &PS_SQLFile.WriteLine(&UpdateText | ";"); Exit 0; End-If;