&ifdef xINHOUSEx
/*!**********************************************************************

  module: wqsql.htm.6w

  -----------------------------------------------------------------------

  responsible:  Wolfgang Auer (D025911 - Wolfgang.Auer@SAP-AG.de)

  special area: SQLStudio WebSQL

  description:  direct sql window in websql

  see also:     

  -----------------------------------------------------------------------


************************************************************************/
&endif

<!------------------------------------------------------------------------>
<!--                                                                    -->
<!--  module: wqsql.htm                                                    -->
<!--                                                                    -->
<!--  ----------------------------------------------------------------    -->
<!--                                                                    -->
<!--  special area: webSQL                                                -->
<!--                                                                    -->
<!--  description:  direct sql window in websql                            -->
<!--  The values of the select elements are used in                        -->
<!--  StudioWeb_Result.cpp don't change them !                            -->
<!--                                                                    -->
<!--  ----------------------------------------------------------------    -->
<!--                                                                    -->
<!--                                                                    -->
<!------------------------------------------------------------------------>

<script language="JavaScript">
<!-- 

function Execute() 
{
    
     document.frmDSQL.action = parent.CreateWebSQLURL("dsql");
       document.frmDSQL.target = "result"
     document.frmDSQL.actiontotake.value = "dsqlexecute";
     
     document.frmDSQL.submit();
}


function refreshDSQLStoredStatement(value) 
{
     if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 4) {

        document.frmHelper.STOREDQUERY.value = unescape(value);
     }
     else{

        document.frmHelper.STOREDQUERY.value = value;
     }
     document.frmDSQL.target = "dsql"
     document.frmHelper.action = parent.CreateWebSQLURL("dsql");
     document.frmHelper.submit();
}


function saveDSQL() {

    var path,input;

    document.frmDSQL.action = parent.CreateWebSQLURL("tree");
    document.frmDSQL.target = "tree"

    document.frmDSQL.actiontotake.value = "savedsql";

    if(document.frmDSQL.pathtostore.value.length < 1)
    {
        if(parent.isSelectedItemAPath(0) == false){

            alert('No Folder selected !');
            return;
        }

        path = parent.getSelectedItemPath(0);
        if(path == '') {
            alert('No valid Folder selected !');
            return;
        }

        input =  prompt('Store File in Folder ' + path + ' :','');
        if(input != null){

            if(input.length > 0) {

                if(parent.checkInputString(input) == false){

                    alert("Invalid Filename !")
                    return;
                }                

                if(path != '/') 
                    document.frmDSQL.pathtostore.value = path + '/' + input;
                else
                    document.frmDSQL.pathtostore.value = path + input;

                document.frmDSQL.overwrite.value = 'no';
                document.frmDSQL.submit();                                
            }
        }
    }
    else{
        document.frmDSQL.overwrite.value = 'yes';
        document.frmDSQL.submit();
    }
}

function setDSQLFocus() {
         document.frmDSQL.dsqlquerytext.focus();
        }

function showHeader() {

    if(top.Header){
        if(!top.Header.userloggedin){

            top.Header.location.href=parent.CreateWebSQLURL("wqheaderpage=logoff");
        }        
    }
    
  }

function doWork() {

    showHeader();
    setDSQLFocus();        
}
// -->
</script>
<body class="BdyStd" topmargin="0" leftmargin="0" onLoad="doWork()">
    <table border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td  height="1" class="STbvCellLayout"><img src="/WARoot/Images/1x1.gif" width="10" height="1"></td>
            <td>
                <form name="frmDSQL" METHOD="POST" target="result" action="?dsql">
                    <p>
                        <!-- TemplateKey StoredStatementPath* -->    
                            %*StoredStatementPath1*%    
                            <input type="hidden" name="pathtostore" value="%*StoredStatementPath2*%">
                        <!-- EndTemplateKey StoredStatementPath* -->
                    </p>
                    <input type="hidden" name="overwrite" value="no">            
                    <input type="hidden" name="actiontotake" value="">    
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="70%">                    
                                <!-- TemplateKey DSqlText -->
                                    <textarea rows="8" name="dsqlquerytext" cols="65">%DSqlText%</textarea>
                                <!-- EndTemplateKey DSqlText -->
                            </td>
                            <td width="1%">&nbsp;</td>
                            <!--  The values of the select elements are used in            -->
                            <!--  StudioWeb_Result.cpp don't change them !!!            -->
                            <td width="25%" valign="top">
                                <!-- TemplateKey StoredStatementProperties* -->    
                                    <table border="1" class="session_props" cellspacing="0"  cellpadding="0" width="100%">
                                        <tr>
                                            <td width="95%">Autocommit: </td>
                                            <td align="left">
                                                <select size="1" name="AutoCommit">
                                                    <option %*StoredStatementProperties1*%>On</option>
                                                    <option %*StoredStatementProperties2*%>Off</option>
                                                  </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="95%">SQL Mode:</td>
                                            <td align="left">
                                                <select size="1" name="SQLMode">
                                                    <option %*StoredStatementProperties3*%>Internal</option>
                                                    <option %*StoredStatementProperties4*%>Oracle</option>
                                                    <option %*StoredStatementProperties5*%>DB2</option>
                                                    <option %*StoredStatementProperties6*%>Ansi</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="95%">Isolationlevel:</td>
                                            <td  align="left">
                                                <select size="1" name="IsolationLevel">
                                                    <option %*StoredStatementProperties7*%>Uncommitted</option>
                                                    <option %*StoredStatementProperties8*%>Committed</option>
                                                    <option %*StoredStatementProperties9*%>Repeatable</option>
                                                    <option %*StoredStatementProperties10*%>Serializable</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="95%">Type:</td>
                                            <td align="left" width="30%" height="10">%*StoredStatementProperties11*%</td>                                
                                        </tr>                        
                                    </table>    
                                </td>
                            <!-- EndTemplateKey StoredStatementProperties* -->            
                        </tr>
                    </table>                        
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td  height="1" class="STbvCellLayout"><img src="/WARoot/Images/1x1.gif" width="1" height="10"></td>
                        </tr>
                        <tr>                
                            <td><script>DisplayEmphButton('Execute','javascript:Execute()','_self',false)</script></td>
                            <td  height="1"class="STbvCellLayout"><img src="/WARoot/Images/1x1.gif" width="1" height="1"></td>
                            <td><script>DisplayStdButton('Clear',parent.CreateWebSQLURL("dsql=clear"),'_self',false)</script></td>            
                            <td  height="1" class="STbvCellLayout"><img src="/WARoot/Images/1x1.gif" width="1" height="1"></td>
                            <td width="10"></td>            
                            <!-- TemplateKey PrevDisabled -->
                                <td><script>DisplayStdButton('Prev Statement',parent.CreateWebSQLURL("dsql=prevstatement"),'_self',%PrevDisabled%)</script></td>            
                            <!-- EndTemplateKey PrevDisabled -->
                            <td  height="1" class="STbvCellLayout"><img src="/WARoot/Images/1x1.gif" width="1" height="1"></td>
                            <!-- TemplateKey NextDisabled -->
                                <td><script>DisplayStdButton('Next Statement',parent.CreateWebSQLURL("dsql=nextstatement"),'_self',%NextDisabled%)</script></td>            
                            <!-- EndTemplateKey NextDisabled -->
                            <td  height="1" class="STbvCellLayout"><img src="/WARoot/Images/1x1.gif" width="10" height="1"></td>
                            <!-- TemplateKey StoreItem -->
                                <td><script>DisplayStdButton('%StoreItem%','javascript:saveDSQL()','_self',false)</script></td>            
                            <!-- EndTemplateKey StoreItem -->
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
        <tr>
            <form name="frmHelper" METHOD="POST" target="dsql" action="?refreshdsql">
                <input type="hidden" name="STOREDQUERY" value="">            
            </form>
        </tr>
    </table>        
</body>
