开窗设计器(adzi210 或 c.q)
在SQL指令中,
SELECT DISTINCT <field>xmdtdocno,xmdtdocdt,xmdtstus,xmdt002,oofa011,xmdt003,ooefl003,xmdtua001,xmdtua002</field>
FROM <table>xmdt_t LEFT OUTER JOIN oofa_t ON oofa002 = '2' AND oofa003 = xmdt002 AND oofaent = xmdtent
LEFT OUTER JOIN ooefl_t ON ooefl001 = xmdt003 AND ooefl002 = :DLANG AND ooeflent = xmdtent</table>
WHERE <wc>xmdtent = :ENT AND xmdtsite = :SITE AND xmdtstus = 'Y'</wc><inwc></inwc>
ORDER BY xmdtdocno
注意WHERE条件:<wc>里面的查询条件在construct和input段都会生效,而写在<inwc>里的查询条件只会在程序input段中生效。
如需添加参数,可见:
SELECT DISTINCT <field>imaa001,imaal003,imaal004</field>
FROM <table>imaa_t LEFT OUTER JOIN imaal_t ON imaa001 = imaal001 AND imaaent = imaalent AND imaal002 = :DLANG </table>
WHERE <wc>imaaent = :ENT AND imaa004 NOT IN ('T','X') AND imaaua003='arg1' AND imaastus = 'Y'</wc>
ORDER BY imaa001
其中系统参数:
:ENT —— 企业编号
:SITE —— 运营据点
:DLANG —— 语别
程序中,传递参数、接收回传值:
例子:
ON ACTION controlp INFIELD pmdsdocno
INITIALIZE g_qryparam.* TO NULL ——开窗前先把参数都初始化空
LET g_qryparam.state = 'c' ——c 是多选, i 是单选
LET g_qryparam.reqry = FALSE ——还没弄明确这个参数作用
LET g_qryparam.where = " pmdsstus ='S' " ——改写开窗查询条件
LET g_qryparam.arg1 = '6' ——传入查询参数,如有多个参数就arg2、arg3...
CALL q_pmdsdocno() ——开窗动作
DISPLAY g_qryparam.return1 TO pmdsdocno ——接收回传值,并显示到pmdsdocno上;如有多个回传值就return2、return3...