declare
VSQL varchar2 (2000);
year varchar2(4);
begin
year:= to_char(sysdate-1,'yyyy');
VSQL:=' create or replace view v_cw_gzmx as
select trim(uni_no)||YM AS WID,UNI_NO AS ZGH,NAME,substr(YM,0,4) AS YEAR, substr(YM,-2) AS MONTH,A1 AS GWGZ,
A2 AS XJGZ,A9 AS ZFBT,A57 AS ZBF,A12 AS BFXJ,A13 AS YFGZ,A16 AS YLBX,A17 AS GHF,A18 AS GJJ,A19 AS GTS,A20 AS GYK,
A21 AS SYJ,A22 AS YBK,A25 AS BKXJ,A26 AS YKHJ,A27 AS SFHJ,A28 AS NSBJ,A36 AS BKYLBX,A37 AS BKGJJ,A41 AS BKYBK,
A50 AS JRF,A59 AS BFJXGZ,A63 AS DHFZLD,A72 AS BFXJGZ,A77 AS TSGWJT,A78 AS GWJTJXA,A79 AS SHBT,A80 AS GLBT,
A81 AS YJKHJLXJX,A82 AS LSXBT,A83 AS ZYNJ, A84 AS BKZYNJ,A85 AS CJJXGZ,trim(FUNDNO) AS GJJZH from SALARY'||year||' ';
execute immediate VSQL;
end;

posted on 2018-12-05 19:49  小人物-烟火  阅读(413)  评论(0编辑  收藏  举报