{"hidden":false,"children":[{"configs":{"itemId":"module"},"expanded":true,"children":[{"configs":{"quoted":"true","itemId":"text","js":"//可以使用app.run运行所有sql语句，包括dql, ddl, dml以及对过程和函数的访问等\n//使用app.run系统会自动关闭用到的connection, statement和resultSet\n//具体使用说明请参考app.run方法和query控件\nvar affectedCount = app.run('update WB_MISC set INT_FIELD=35 where 1=0'); //update语句返回影响记录数\nvar text = [],\n  result = app.run('select * from WB_MISC'); //获得结果集\nwhile (result.next()) {\n  text.push(result.getString('STRING_FIELD')); //读取指定名称字段内容到数组\n}\napp.send(text.join(',')); //发送到客户端"},"expanded":false,"children":[],"type":"string"},{"configs":{"layout":"fit","itemId":"viewport1"},"expanded":true,"children":[{"configs":{"itemId":"xwl1","file":"m?xwl=sys/dialog/dev/script-editor"},"expanded":false,"children":[],"type":"xwl"}],"type":"viewport","events":{"afterrender":"app.xwl1.setValue(\"{#text#}\", null, true);"}}],"type":"module"}],"roles":{"demo":1},"title":"运行 SQL 语句","iconCls":"","inframe":false,"pageLink":""}