sneha,

For the "if exists" you could try the when no_data_found exception:

BEGIN
SELECT *
FROM Users
WHERE UserID = @UserID;
... -- update codes here
EXCEPTION
WHEN NO_DATA_FOUND THEN
... -- insert codes here
END;

For "from inserted" you can use the :NEW qualifier like :NEW.UserID, :NEW.AppUserName, :NEW.FirstName, etc. You would assign the variables to this values.


Check the Oracle Docs for more info on triggers.

hth.