Hi All
I am getting the following error while executing this function.
CREATE FUNCTION SABA_REPORT.SCF_OVERVIEWFORTRAININGADMIN_ASSIGN_CO ST222
(@plan varchar(20) ,
@manager varCHAR(20),
@currentUser varCHAR(20),
@organization varchar(25) ,
@javaLocale VARCHAR(25) )
RETURNS float
LANGUAGE SQL
READS SQL
DATA format:
BEGIN ATOMIC
declare @n_cost float;
declare @n_cost1 float;
declare @n_cost2 float;
declare @@currency char(20);
set @@currency=( select acurr.currency_id from scv_acc_party_account pacct
inner join tpv_pub_account_currency acurr on pacct.ACCOUNT_ID=acurr.account_id
inner join cmv_pub_smp_person p on p.company_id=pacct.PARTY_ID
where p.id=@currentUser and left(acurr.flags,1)='1');
set @n_cost =0.00;
set @n_cost1=( select
coalesce(scf_off_cost222(ot.id,pl.assignee_id,@cur rentUser, @javaLocale),0) cost
from
scv_plan pl
inner join cmv_pub_plan_activity plact on pl.id=plact.plan_id
inner join scv_cmt_activity act on act.id=plact.activity_id
inner join TPV_PUB_I18N_SMP_OFFERING_TEMP ot on act.act_defn_id=ot.id
inner join fgv_sys_list_of_val lov on act.srcbl_status=lov.name
and lov.list_id =( case when act.srcbl_status='100' then 'sysli000000000000173'else 'sysli000000000000163' end)
inner join cmv_pub_smp_person p3 on pl.assignee_id=p3.id
inner join tpv_pub_all_org cmp on p3.company_id=cmp.id
inner join cmv_pub_smp_person p4 on act.source_id=p4.id
where
lov.locale_id=ot.locale_id
and ot.locale_id=@javaLocale
and ( cast(p3.terminated_on as date) > current_date or p3.terminated_on is null )
and lov.description not in ('Rejected','On Hold')
and pl.status not in ('600','400')
and pl.plan_form_id=@plan
and cmp.id=@organization
and coalesce(p3.manager_id,'abc') like @manager ||'%' ******I think This is a problem area*****
);
set @n_cost = @n_cost1;
return @n_cost;
end format
While executing this function i am getting following error.
DB2 SQL error: SQLCODE: -132, SQLSTATE: 42824, SQLERRMC: null
Message: A LIKE predicate or POSSTR scalar function is not valid because the first operand is not a string expression or the second operand is not a string. A LOCATE or POSITION scalar function is not valid because the first operand is not a string or the second operand is not a string expression.
Line: 24
Regards
Vishal