修改完整版的sql存储(积分兑换脚本),改写出可执行的shell update "rpt_wjq_jf_value_dhfz_list" as "a" set "a"."club_level" = case when "b"."star_level" = '3100' then '1星' when "b"."star_level" = '3200' then '2星' when "b"."star_level" = '3300' then '3星' when "b"."star_level" = '3400' then '4星' when "b"."star_level" = '3500' then '5星' when "b"."star_level" = '3600' then '6星' when "b"."star_level" = '3700' then '7星' else '0星' end from "rptdev"."rpt_comm_cm_serv_cdma" as "b" where "a"."cust_id" = "b"."cust_id"; commit work;
时间: 2023-10-26 14:06:17 浏览: 124
shiyan.rar_Rpt_Hour_shiyan.58.vom
以下是修改后的可执行的 shell 脚本:
#!/bin/bash
# 更新会员等级
isql -Usa -Ppassword -SSYBASE -w 999 -b -o /dev/null <<EOF
update rpt_wjq_jf_value_dhfz_list as a
set a.club_level = case
when b.star_level = '3100' then '1星'
when b.star_level = '3200' then '2星'
when b.star_level = '3300' then '3星'
when b.star_level = '3400' then '4星'
when b.star_level = '3500' then '5星'
when b.star_level = '3600' then '6星'
when b.star_level = '3700' then '7星'
else '0星'
end
from rptdev.rpt_comm_cm_serv_cdma as b
where a.cust_id = b.cust_id;
commit work;
EOF
echo "脚本执行完成!"
阅读全文