Edit: Below update won't work due to ORA-01776 error (thanks Vincent). See end of post for new method.
You are trying to update a function result. This is not possible. I presume you are trying to update the underlying value that is retrieved by the function. To do this you will need to combine the function code with the join between Organization and Property.
Let's say GET_PROPERTY is:
CREATE OR REPLACE FUNCTION GET_PROPERTY
(
objectID_in NUMBER,
propertyName_in VARCHAR
)
AS
v_returnValue VARCHAR(32);
BEGIN
SELECT
PropertyValue INTO v_returnValue
FROM
PropertyTable
WHERE
ObjectID = objectID_in
AND PropertyName = propertyName_in;
RETURN v_returnValue;
END
Your update would become:
--This wouldn't have worked.
Edit: Best to write a procedure to do it.
CREATE PROCEDURE UpdateMyTwoTables
(
orgExternalKey_in in VARCHAR,
propertyIdx_in in NUMBER,
propertyName_in in VARCHAR,
newValue_in in VARCHAR,
newPropertyValue_in in VARCHAR
)
AS
BEGIN
UPDATE
(SELECT
ORG.Value
FROM
ORGANIZATION ORG,
PROPERTY P
WHERE
ORG.EXTERNALKEY = orgExternalKey_in
AND P.ID = ORG.ID AND
P.IDX = propertyIdx_in)
SET
Value = newValue_in;
UPDATE
(SELECT
PropertyValue
FROM
PropertyTable,
ORGANIZATION ORG,
PROPERTY P
WHERE
PropertyTable.objectID = ORG.ID
AND ORG.ID = P.ID
AND ORG.EXTERNALKEY = orgExternalKey_in
AND P.Idx = propertyIdx_in
AND PropertyTable.PropertyName = propertyName_in)
SET
PropertyValue = newPropertyValue_in;
END;