dear masbin , udah bisa di test ya di client udah di deploy ke sana
package :
update function GetPositionHead
berikut updatenya :
ALTER FUNCTION [dbo].[GetPositionHead]
(
@org_unit varchar(8),
@key_date varchar(8)
)
RETURNS varchar(8)
AS
--DECLARE @org_unit varchar(8) = '00000002'
--DECLARE @key_date varchar(8) = '20170829'
BEGIN
-- Declare the return variable here
DECLARE @position_head varchar(8)
-- Add the T-SQL statements to compute the return value here
--SELECT @position_head = dbo.[GetObjRel](@org_unit,'O','A','001','P',@key_date)
SELECT @position_head = O2.RelationshipObject
FROM dbo.PHROM0002 O2 INNER JOIN
dbo.PHROM0001 O1 ON O2.RelationshipObject = O1.ObjectID
AND O1.StartDate <= @key_date
AND O1.EndDate >= @key_date
AND O1.ObjectClass = 'P'
AND O1.PositionHead = '1'
WHERE O2.ObjectID = @org_unit
AND O2.ObjectClass = 'O'
AND O2.RelationshipDirectory = 'A'
AND O2.RelationshipType = '001'
AND O2.RelationshipClass = 'P'
AND O2.StartDate <= @key_date
AND O2.EndDate >= @key_date
SET @position_head = ISNULL(@position_head,'')
-- Return the result of the function
RETURN @position_head
END
makasih