にDB2関数の変換、私はこのことから機能を変換しました:は、SQL Serverの機能
create function prf_t_excinter_nzw(AC_ID_i int, TFH_i double) specific prf_t_excinter_nzw
RETURNS TABLE(ft_id int,rg_id int,thr double,value double )
R1: BEGIN ATOMIC
RETURN select l.ft_id, l.rg_id, r.thr, case when l.from is null
then to_value else (thr - from)/(to - from) * (to_value - from_value) + from_value end as value
from ( select ft_id, rg_id, to, from, to_value, from_value from ( select row_number() over (
partition by l.ft_id, l.rg_id, l.thr order by l.ft_id, l.rg_id, l.thr, r.thr desc) as #,
l.ft_id, l.rg_id, l.thr as to, r.thr as from, l.value as to_value, r.value as from_value
from (select ft_id, rg_id, thr, value from table (prf_t_ftexc_nzw(AC_ID_i, TFH_i)) as d
order by ft_id, rg_id, thr asc ) as l
left outer join ( select ft_id, rg_id, thr, value from table (prf_t_ftexc_nzw(AC_ID_i, TFH_i)) as d order by ft_id, rg_id, thr asc) as r
on l.ft_id = r.ft_id and l.rg_id = r.rg_id and l.thr > r.thr ) as l_r where # = 1 ) as l join ( select prm_id, thr from prf_t_prm_1d_thr as r
where prm_id in (select id from prf_t_prm where name like '%RG_NZW') ) as r on l.rg_id = r.prm_id and(l.from < r.thr or l.from is null) and (r.thr <= l.to)
order by l.ft_id, l.rg_id, r.thr ; END
これに:この時点で
create function prf_t_excinter_nzw(@AC_ID_i int,@TFH_i float)
RETURNS TABLE
RETURN select l.ft_id, l.rg_id, r.thr,case when l.from_value is null then to_value else (thr-from_value)/(to_value-from_value)*(to_value-from_value)+from_value end as value
from (
select ft_id,rg_id,to_value,from_value,to_value,from_value
from (
select row_number() over (partition by l.ft_id, l.rg_id, l.thr order by l.ft_id,l.rg_id, l.thr, r.thr desc) as num, l.ft_id, l.rg_id, l.to_value, r.from_value
from (
select ft_id, rg_id, thr, ac_value as to_value
from prf_t_ftexc_nzw(@AC_ID_i,@TFH_i) as d) as l
left outer join (
select ft_id, rg_id, thr, ac_value as from_value
from prf_t_ftexc_nzw(@AC_ID_i,@TFH_i) as d) as r
on l.ft_id = r.ft_id
and l.rg_id=r.rg_id
and l.thr > r.thr) as l_r
where num = 1) as l
join (
select prm_id, thr from prf_t_prm_1d_thr as r
where prm_id in (select id from prf_t_prm where name like '%RG_NZW')) as r
on l.rg_id=r.prm_id and (l.from_value<r.thr or l.from_value is null)
and (r.thr<=l.to_value)
私はメッセージ8156、レベル16、状態1、プロシージャprf_t_excinter_nzw、ライン18 エラーを取得しています列「to_valueは」「l」の 任意のヒント/ための複数回指定されました修正するための提案?
MicrosoftからSSMA 6.0.1をDB2ツール用に試しましたか? http://www.microsoft.com/en-us/download/details.aspx?id=51216 – Hiten004
@ Hiten004 SSMA 6.0.0で変換しようとしましたが失敗しました。最新バージョンで試してみることもできますが、それは6.0.2だと思う。 – James
あなたはエラーを調べましたか?私はそれを質問として投稿したいと思うかもしれません! – Hiten004