回复 24楼 红星二锅头
prq=DTOC(DATE())
pzf="insert into Health_Data([Inspect_ID] ,[UserID] ,[InTheDate],[Inspect_category] ,[Inspect_name] ,[Inspect_part],[Inspect_content],[Chronic_mark] ,[Docter] ,cardid,name)"
pzf2="values('&pcfh','','&psfrq','&pcflb',"
pzf3="'&pmc','',"
pzf4="'&pznr',"
pzf5="0,'&pys','&ppkh','&pxm1')"
zzf="&pzf"+" "+"&pzf2"+"&pzf3"+"&pzf4"+"&pzf5"
SQLEXEC(h2,zzf)
SQLEXEC(h1,"update ad_prescription_memo set scrq='&prq' where prm_number='&pcfh'")
SKIP
enddo
ENDIF
PLis="select A.ReceiveDate,A.SectionNo,A.SampleNo,A.PatNo,,A.Age,A.Operator, from ReportForm A,Department B "
PLis1="where A.DeptNo=B.Deptno and (ReceiveDate='&date2')and(SectionNo=3) and "
Plis2=" (SectionNo=1 or SectionNo=2 or SectionNo=3 or SectionNo=4 or SectionNo=5 or "
PLis3=" SectionNo=6 or SectionNo=7 or SectionNo=8 or SectionNo=9 or SectionNo=10) "
ZPLis="&PLis"+" "+"&PLis1"+" "+"&PLis2"+" "+"&PLis3"
abb1=Sqlexe(h3,ZPLis)
Copy TO Plis
SELECT 0
USE PLis ALIAS Plis
Pbgao="select RI.*,TI.ShortName as ItemName, as ItemCName,TI.EName as ItemEName,TI.Unit as ItemUnit,RI.ReportDesc as ItemValue,TI.cuegrade,TI.DispOrder,TI.secretgrade from ReportItem RI,TestItem TI "
Pbgao1="where (RI.ItemNo=TI.ItemNo)and(ReceiveDate='&date2')and(SectionNo=3)and"
Pbgao2="((TI.secretgrade & convert(binary(2),16)<>16) or (TI.secretgrade IS NULL) or (TI.secretgrade=-1))
order by TI.DispOrder"
ZPbgao="&pbgao"+" "+"&pbgao1"+" "+"&pbgao2"
abb2=SQLEXEC(h3,ZPbgao)
COPY TO Pbgao
SELECT 0
USE Pbgao ALIAS Pbgao
我用了这么多宏替换的语句都没问题,就是出现超长字符串的时候才报错的,所以没引起注意,非常感谢!