SMZSL00201_SQL실행기.xrw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>SQL 실행기</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <result>
  11. <resultset/>
  12. </result>
  13. <sql/>
  14. <sqltype>select</sqltype>
  15. <pagequery>true</pagequery>
  16. <maxcount>1000</maxcount>
  17. </main>
  18. <send>
  19. <sql/>
  20. <datasource>comdb</datasource>
  21. <maxcount>1000</maxcount>
  22. <offset/>
  23. <rollback/>
  24. <sqltype/>
  25. <params>
  26. <pname/>
  27. <pvalue/>
  28. </params>
  29. <totcnt>false</totcnt>
  30. </send>
  31. <init>
  32. <sqlpopupitem>
  33. <item>
  34. <name>select 실행</name>
  35. <func>fSubmitSelect</func>
  36. </item>
  37. <item>
  38. <name>insert/update/delete 실행</name>
  39. <func>fSubmitUpdate</func>
  40. </item>
  41. <item>
  42. <name>procedure call 실행</name>
  43. <func>fSubmitCall</func>
  44. </item>
  45. </sqlpopupitem>
  46. </init>
  47. <temp/>
  48. </root>
  49. </instance>
  50. <script type="javascript" ev:event="xforms-ready">
  51. <![CDATA[
  52. fInitialize();
  53. ]]>
  54. </script>
  55. <submission id="TXZSL00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/result/resultset"/>
  56. <submission id="TRZSL00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/result/resultset"/>
  57. </model>
  58. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  59. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  60. <script type="javascript">
  61. <![CDATA[
  62. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  63. function fInitialize() {
  64. grd_resultset.rebuild();
  65. model.resetInstanceNode("/root/main/sql");
  66. model.setValue("/root/main/sqltype","select");
  67. model.setValue("/root/main/maxcount",1000);
  68. model.setValue("/root/main/pagequery","true");
  69. model.setValue("/root/send/datasource","comdb");
  70. model.setValue("/root/send/maxcount",1000);
  71. model.resetInstanceNode("/root/send/sql");
  72. model.resetInstanceNode("/root/send/offset");
  73. model.resetInstanceNode("/root/send/rollback");
  74. model.resetInstanceNode("/root/send/sqltype");
  75. model.removeNodeset("/root/send/params");
  76. model.refresh();
  77. }
  78. function fSubmitExecute() {
  79. var sqlText = model.getValue("/root/main/sql");
  80. model.makeValue("/root/send/sql",sqlText);
  81. var sqlType = model.getValue("/root/main/sqltype");
  82. model.makeValue("/root/send/sqltype",sqlType);
  83. grd_resultset.rebuild();
  84. if (sqlType == "select") {
  85. submit("TRZSL00201");
  86. } else {
  87. submit("TXZSL00201");
  88. }
  89. }
  90. function fSubmitSelect() {
  91. model.makeValue("/root/send/sqltype","select");
  92. submit("TRZSL00201");
  93. }
  94. function fSubmitUpdate() {
  95. model.makeValue("/root/send/sqltype","update");
  96. submit("TXZSL00201");
  97. }
  98. function fSubmitCall() {
  99. model.makeValue("/root/send/sqltype","call");
  100. submit("TXZSL00201");
  101. }
  102. ]]>
  103. </script>
  104. </xhtml:head>
  105. <xhtml:body guideline="1,1196;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  106. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  107. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:189px; height:14px; ">SQL 실행기</caption>
  108. </group>
  109. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1195px; height:744px; ">
  110. <line id="line4" class="line_2" style="x1:0px; y1:740px; x2:1194px; y2:740px; "/>
  111. <group id="group2" style="left:0px; top:14px; width:1194px; height:35px; vertical-align:top; ">
  112. <shape id="roundrect1" appearance="roundrect" style="left:0px; top:0px; width:1194px; height:35px; "/>
  113. <caption id="caption2" class="search_name" style="left:16px; top:8px; width:114px; height:17px; ">datasource :</caption>
  114. <line id="line13" style="x1:1121px; y1:7px; x2:1121px; y2:29px; border-color:#ffe4bb; border-left-style:solid; "/>
  115. <select id="chk_rollback" ref="/root/send/rollback" navindex="3" overflow="visible" appearance="full" style="left:1030px; top:10px; width:80px; height:17px; border-style:none; ">
  116. <choices>
  117. <item>
  118. <label>Rollback</label>
  119. <value>true</value>
  120. </item>
  121. </choices>
  122. </select>
  123. <select1 id="cmb_datasource" ref="/root/send/datasource" class="combo_search" navindex="1" appearance="minimal" style="left:140px; top:8px; width:110px; height:19px; ">
  124. <choices>
  125. <item>
  126. <label>comdb</label>
  127. <value>comdb</value>
  128. </item>
  129. <item>
  130. <label>emrdb</label>
  131. <value>emrdb</value>
  132. </item>
  133. <item>
  134. <label>pamdb</label>
  135. <value>pamdb</value>
  136. </item>
  137. <item>
  138. <label>astdb</label>
  139. <value>astdb</value>
  140. </item>
  141. <item>
  142. <label>lisdb</label>
  143. <value>lisdb</value>
  144. </item>
  145. <item>
  146. <label>misdb</label>
  147. <value>misdb</value>
  148. </item>
  149. <item>
  150. <label>tisdb</label>
  151. <value>tisdb</value>
  152. </item>
  153. <item>
  154. <label>crmdb</label>
  155. <value>crmdb</value>
  156. </item>
  157. <item>
  158. <label>cmcdb</label>
  159. <value>cmcdb</value>
  160. </item>
  161. <item>
  162. <label>sybdb</label>
  163. <value>sybdb</value>
  164. </item>
  165. <item>
  166. <label>bnsdb</label>
  167. <value>bnsdb</value>
  168. </item>
  169. <item>
  170. <label>edsdb</label>
  171. <value>edsdb</value>
  172. </item>
  173. </choices>
  174. </select1>
  175. <button id="btn_execute" class="btn1_letter2" navindex="4" style="left:1132px; top:7px; width:56px; height:22px; ">
  176. <caption>실행</caption>
  177. <script type="javascript" ev:event="DOMActivate">
  178. <![CDATA[
  179. if (chk_pagequery.value == "true") {
  180. ipt_maxcount.disabled = false;
  181. model.makeValue("/root/send/maxcount",model.getValue("/root/main/maxcount"));
  182. } else {
  183. ipt_maxcount.disabled = true;
  184. model.makeValue("/root/send/maxcount",0);
  185. }
  186. //model.makeValue("/root/send/maxcount",model.getValue("/root/main/maxcount"));
  187. fSubmitExecute();
  188. //model.send("TXZSL00201");
  189. ]]>
  190. </script>
  191. </button>
  192. <select1 id="cmb_sqltype" ref="/root/main/sqltype" navindex="2" appearance="minimal" style="left:845px; top:8px; width:165px; height:19px; ">
  193. <choices>
  194. <item>
  195. <label>select</label>
  196. <value>select</value>
  197. </item>
  198. <item>
  199. <label>insert/update/delete</label>
  200. <value>update</value>
  201. </item>
  202. <item>
  203. <label>call</label>
  204. <value>call</value>
  205. </item>
  206. </choices>
  207. </select1>
  208. </group>
  209. <caption id="caption1" class="tit_2" style="left:6px; top:370px; width:139px; height:14px; ">Result Set</caption>
  210. <line id="line1" class="line_1" style="x1:0px; y1:385px; x2:1194px; y2:385px; "/>
  211. <caption id="cap_msgcnts3" class="cell_1" style="left:925px; top:390px; width:100px; height:23px; ">object size(est.)</caption>
  212. <caption id="caption20" class="tit_2" style="left:6px; top:62px; width:149px; height:14px; ">SQL parameters</caption>
  213. <line id="line8" class="line_1" style="x1:0px; y1:77px; x2:235px; y2:77px; "/>
  214. <line id="line7" class="line_3" style="x1:0px; y1:741px; x2:1194px; y2:741px; "/>
  215. <line id="line2" class="line_1" style="x1:240px; y1:77px; x2:1194px; y2:77px; "/>
  216. <caption id="caption3" class="tit_2" style="left:245px; top:62px; width:149px; height:14px; ">SQL</caption>
  217. <datagrid id="grd_params" nodeset="/root/send/params" caption="name^value" colwidth="100, 100" dataheight="25" defaultrows="0" explorerbar="sort" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" style="left:0px; top:82px; width:235px; height:277px; ">
  218. <col ref="pname" type="input" style="text-align:left; word-wrap:none; "/>
  219. <col ref="pvalue" type="input" style="text-align:center; "/>
  220. </datagrid>
  221. <textarea id="tar_sql" ref="/root/main/sql" navindex="5" style="left:240px; top:82px; width:954px; height:277px; ">
  222. <script type="javascript" ev:event="onmousedown">
  223. <![CDATA[
  224. setPopupMenu("tar_sql",false,"/root/init/sqlpopupitem/item","name","func");
  225. ]]>
  226. </script>
  227. <script type="javascript" ev:event="DOMFocusOut">
  228. <![CDATA[
  229. initPopupMenu();
  230. ]]>
  231. </script>
  232. </textarea>
  233. <button id="btn_addparam" class="icon_plus" style="left:200px; top:60px; width:13px; height:15px; ">
  234. <caption/>
  235. <script type="javascript" ev:event="DOMActivate">
  236. <![CDATA[
  237. grd_params.addRow();
  238. ]]>
  239. </script>
  240. </button>
  241. <button id="btn_delparam" class="icon_minus" style="left:220px; top:60px; width:13px; height:15px; ">
  242. <caption/>
  243. <script type="javascript" ev:event="DOMActivate">
  244. <![CDATA[
  245. var cur_row = grd_params.row;
  246. grd_params.deleteRow(cur_row);
  247. ]]>
  248. </script>
  249. </button>
  250. <datagrid id="grd_resultset" nodeset="/root/main/result/resultset" caption="column" colsep="^" colwidth="79" datatype="delimeter" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:0px; top:390px; width:1193px; height:350px; ">
  251. <col ref="depth"/>
  252. </datagrid>
  253. <button id="btn_clearsql" class="btn2_letter3" style="left:1138px; top:55px; width:53px; height:19px; ">
  254. <caption>clear</caption>
  255. <script type="javascript" ev:event="DOMActivate">
  256. <![CDATA[
  257. model.resetInstanceNode("/root/main/sql");
  258. model.refresh();
  259. ]]>
  260. </script>
  261. </button>
  262. <input id="ipt_maxcount" ref="/root/main/maxcount" style="left:1050px; top:363px; width:109px; height:19px; "/>
  263. <button id="btn_nextresult" class="icon_right" visibility="hidden" style="left:1165px; top:363px; width:26px; height:19px; ">
  264. <caption/>
  265. <script type="javascript" ev:event="DOMActivate">
  266. <![CDATA[
  267. model.makeValue("/root/send/offset",grd_resultset.rows-1);
  268. fSubmitExecute();
  269. ]]>
  270. </script>
  271. </button>
  272. <select id="chk_pagequery" ref="/root/main/pagequery" overflow="visible" appearance="full" style="left:945px; top:365px; width:100px; height:20px; border-style:none; ">
  273. <choices>
  274. <item>
  275. <label>Page query</label>
  276. <value>true</value>
  277. </item>
  278. </choices>
  279. <script type="javascript" ev:event="xforms-value-changed">
  280. <![CDATA[
  281. if (chk_pagequery.value == "true") {
  282. ipt_maxcount.disabled = false;
  283. //model.makeValue("/root/send/maxcount",model.getValue("/root/main/maxcount"));
  284. } else {
  285. ipt_maxcount.disabled = true;
  286. //model.makeValue("/root/send/maxcount",0);
  287. }
  288. ]]>
  289. </script>
  290. </select>
  291. </group>
  292. <group id="group4" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  293. <line id="line32" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  294. <button id="btn_init" class="btn4_letter3" navindex="6" style="left:1126px; top:3px; width:68px; height:22px; ">
  295. <caption>초기화</caption>
  296. <script type="javascript" ev:event="DOMActivate">
  297. <![CDATA[
  298. fInitialize();
  299. ]]>
  300. </script>
  301. </button>
  302. </group>
  303. </xhtml:body>
  304. </xhtml:html>