标签:sql ISE 运行 select ima bsp cti query rom
这个很简单,直接上码。
服务器端声明过程
[kbmMW_Rest(‘method:get, path:querytable‘)] [kbmMW_Method] function querytable( [kbmMW_Rest(‘value: "$tname", required: true‘)] const tblname:string; [kbmMW_Rest(‘value: "$id", required: true‘)] const id:string):Tkbmmemtable;
具体实现代码
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
原文地址:https://www.cnblogs.com/xalion/p/10164798.html