123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet type="text/css" href="../../commonweb/css/common.css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>SQL 생성기</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <sql/>
- <param1/>
- <result/>
- </main>
- </root>
- </instance>
- </model>
- <script type="javascript" src="../../commonweb/js/common.js"/>
- <script type="javascript">
- <![CDATA[
- function fGenerateSQL() {
- var rawSql = model.getValue("/root/main/sql");
- var param1s = model.getValue("/root/main/param1").split(",");
-
- var param1sIndex = 0;
- var index = 0;
-
- rawSql = rawSql.replace(/\$|#/g, "/*param1*/");
- for (var i = 0, length = param1s.length; i < length; i++) {
-
- rawSql = rawSql.replace(/\/\*param1\*\//, param1s[param1sIndex++]);
- }
- /*
- while (true) {
- var hexp = new RegExp("(#|$)", "gi");
-
- var w = rawSql.match(wexp);
-
- stringIndex = rawSql.indexOf("$", index);
- digitIndex = rawSql.indexOf("#", index);
-
- if (stringIndex == -1 && digitIndex == -1) {
- break;
- }
- if (digitIndex == -1 && stringIndex != -1) {
- index = stringIndex;
- } else
- if (digitIndex != -1 && stringIndex == -1) {
- index = digitIndex;
- } else
- if (digitIndex < stringIndex) {
- index = stringIndex;
- } else
- if (digitIndex > stringIndex) {
- index = digitIndex;
- }
- rawSql = rawSql.substring(0, index) + param1s[param1sIndex++] + rawSql.substring(index +1);
- }
- */
-
- rawSql = rawSql.substring(1, rawSql.length - 2);
- return rawSql;
- }
-
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body>
- <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:189px; height:14px; ">SQL 생성기</caption>
- <line id="line32" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
- <caption id="caption3" class="tit_2" style="left:5px; top:40px; width:149px; height:13px; ">SQL</caption>
- <line id="line2" class="line_1" style="x1:0px; y1:55px; x2:1190px; y2:55px; "/>
- <textarea id="tar_sql" ref="/root/main/sql" navindex="5" style="left:0px; top:60px; width:1190px; height:277px; "/>
- <input id="input1" ref="/root/main/param1" style="left:0px; top:370px; width:1190px; height:19px; "/>
- <caption id="caption1" class="tit_2" style="left:5px; top:350px; width:149px; height:14px; ">PARAM1</caption>
- <line id="line1" class="line_1" style="x1:0px; y1:365px; x2:1190px; y2:365px; "/>
- <textarea id="tar_result" ref="/root/main/result" navindex="5" style="left:0px; top:425px; width:1190px; height:350px; "/>
- <caption id="caption2" class="tit_2" style="left:0px; top:405px; width:149px; height:13px; ">RESULT</caption>
- <line id="line3" class="line_1" style="x1:0px; y1:420px; x2:1190px; y2:420px; "/>
- <button id="btn_clearsql" class="btn2_letter3" style="left:1138px; top:30px; width:53px; height:19px; ">
- <caption>clear</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- model.resetInstanceNode("/root/main");
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_generate" class="btn2_letter2" style="left:1100px; top:395px; width:42px; height:19px; ">
- <caption>생성</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var result = fGenerateSQL();
- model.setValue("/root/main/result", result);
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_copy" class="btn2_letter2" style="left:1147px; top:395px; width:42px; height:19px; ">
- <caption>복사</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- window.clipBoardData = model.getValue("/root/main/result");
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|