时间:2021-07-01 10:21:17 帮助过:19人阅读
具体实现代码
function TkbmMWCustomHTTPSmartService1.querytable(const tblname, id: string): Tkbmmemtable; var sqls:string; begin if tblname=‘‘ then begin kbmMWRaiseHTTPError(500,‘result:{"ok":"error","value":"table not exist! "}‘); end; sqls:=‘select * from ‘+tblname; if id<>‘‘ then begin sqls:=sqls+‘ where CustNo=‘+id; end; cx.sql.text:=sqls; try cx.open; except on e:exception do kbmMWRaiseHTTPError(500 ,e.Message); end; result:=Tkbmmemtable(cx); end;
运行结果
使用kbmmw smarthttpservice 简单返回数据库结果
标签:sql ISE 运行 select ima bsp cti query rom