编导专业自我介绍范文:PowerBuilder中的嵌入式SQL问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 09:01:35
我编了一段计算工资的程序,游标部分还是可以用的,但到了SQL部分程序运行时就没有什么反应了,检查不出什么问题,还请高手多多指教~

变量申明略。

bill_month1=date(em_1.text)
delivery_date1=date(em_2.text)
declare cs_empl cursor for
select empl_ID,title,edu_degree,los,city,per_name,float_pay
from employees;
open cs_empl;
fetch cs_empl into :empl_ID1,:title1,:edu_degree1,:los1,:city1,&
:per_name1,:float_pay1;
do while sqlca.sqlcode=0

//四金、加班、请假单价
select holiday_ovt,daily_ovt,late_ddc,prvtleave_ddc,sick_ddc,
pension_ddc,medicare_ddc,unemplm_ddc,housing_ddc
into :holiday_ovt1,:daily_ovt1,:late_ddc1,
:prvtleave_ddc1,:sick_ddc1,:pension_ddc1,:medicare_ddc1,
:unemplm_ddc1,:housing_ddc1
from per_pay
where per_pay.per_name=per_name1;

//职位基本工资
select base_pay,housing_allw,traffic_allw,food_allw,
attendance_allw,allowance,prj_bonus
into :base_pay1,:housing_allw1,:traffic_allw1,:food_allw1,
:attendance_allw1,:allowance1,:prj_bonus1
from titles
where titles.title=:title1;

//学历工资
select edu_pay
into :edu_pay1
from education
where education.edu_degree=:edu_degree1;

//工龄工资
select los_pay
into :los_pay1
from length_of_svc
where length_of_svc.length=:los1;

//考勤记录
select holiday_hour,daily_hour,late_time,prvtleace_day,sick_day
into :holiday_hour1,:daily_hour1,:late_time1,:prvtleace_day1,:sick_day1
from attendance
where attendance.empl_ID=:empl_ID1 and attendance.attd_month=:bill_month1;

//个税起缴额
select income
into :income1
from cities
where cities.city=:city1;

bill_ID2=string(bill_month1,"yyyymm")+string(empl_ID1,"0000")

////工资计算部分略

fetch cs_empl into :empl_ID1,:title1,:edu_degree1,:los1,:city1,:per_name1,:float_pay1;
loop

close cs_empl;