标题:如何将超过254字符内容更新至sql中
取消只看楼主
ttlover7613
Rank: 2
等 级:论坛游民
威 望:2
帖 子:48
专家分:85
注 册:2016-8-29
得分:0 
回复 24楼 红星二锅头
关键是用宏替换也可以正常运行呀,但有长度限制。
2016-08-30 17:24
ttlover7613
Rank: 2
等 级:论坛游民
威 望:2
帖 子:48
专家分:85
注 册:2016-8-29
得分:0 
回复 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
我用了这么多宏替换的语句都没问题,就是出现超长字符串的时候才报错的,所以没引起注意,非常感谢!
2016-08-30 17:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-468275-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019817 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved