Function Data_Map_Test(OITableName, OIKeyID, TableFunction)

Declare function    Database_Services, SQL_Services, Error_Services
Declare subroutine  Database_Services, SQL_Services, Error_Services, Memory_Services

Error   = ''
* Memory_Services('ReleaseHashTable')


If (OITableName NE '') AND (OIKeyID NE '') then
    OIRow   = Database_Services('ReadDataRow', OITableName, OIKeyID)
    If Error_Services('NoError') then
    	IF TableFunction EQ 'WRITE' Then
*Debug
			SQL_Services('WriteDataRowToSQL', OITablename, OIKeyID, OIRow)
        end else
        	If TableFunction EQ 'DELETE' Then
        		SQL_Services('DeleteDataRowFromSQL', OITablename, OIKeyID, OIRow)
        	end
        end
        If Error_Services('HasError') then
            Error   = Error_Services('GetMessage')
        end
    end else
        Error   = Error_Services('GetMessage')
    end
end else
    Error   = 'TableName or KeyID is missing.'
end

Return Error



