var g_conCount = 1; var g_fkCount = 1; var g_ukCount = 1; /*Shows hides values*/ function ob_TableToggleType(pThis){ var l_HolderTR = html_CascadeUpTill(pThis,'TR'); var l_Inputs = l_HolderTR.getElementsByTagName('input'); var l_Size = l_Inputs[1]; var l_Scale = l_Inputs[2]; var l_Comments = l_Inputs[3]; html_VisibleElement(l_Comments); switch(pThis.value){ case "NUMBER": html_VisibleElement(l_Scale); if(l_Scale.value>38){l_Scale.value=''} html_VisibleElement(l_Size); if((l_Size.value.length>0)&&(l_Scale.value.length==0)){l_Size.value=''} break; case "CLOB": case "BLOB": case "DATE": case "TIMESTAMP": html_HiddenElement(l_Scale); html_HiddenElement(l_Size); break; case "VARCHAR2": html_VisibleElement(l_Scale); if((l_Scale.value>4000)||(l_Scale.value.length == 0)) {l_Scale.value='4000'} html_HiddenElement(l_Size); break; case "NVARCHAR2": html_VisibleElement(l_Scale); if((l_Scale.value>2000)||(l_Scale.value.length == 0)) {l_Scale.value='2000'} html_HiddenElement(l_Size); break; case "CHAR": html_VisibleElement(l_Scale); html_HiddenElement(l_Size); if((l_Scale.value>100)||(l_Scale.value.length == 0)) {l_Scale.value='100'} break; case "BINARY_FLOAT": html_HiddenElement(l_Scale); html_HiddenElement(l_Size); break; case "BINARY_DOUBLE": html_HiddenElement(l_Scale); html_HiddenElement(l_Size); break; default: html_HiddenElement(l_Scale); html_HiddenElement(l_Size); html_HiddenElement(l_Comments); break; } return; } function addTableRow2(pThis,pThat,pNum){ var tt = html_GetElement(pThat); var l_newRows = new Array(); for(i=0;i 0) { dOptions = dOptions+','; } dOptions = dOptions+sList[intLoop].value; } return dOptions; } function ob_addFk() { // to table var toTable = html_GetElement('P145_FK_REF_TABLE').value; // to columns var toCols = ob_getOpts('P145_FK_REF_COLUMN_SEL'); // from columns var fromCols = ob_getOpts('P145_FK_THIS_COLUMN_SEL'); // fk name var fkName = html_GetElement('P145_FK_NAME').value; // fk action var fkAction = html_RadioValue('P145_FK_ACTION'); // holders var fkHolder = html_GetElement('htmldbNewTable'); var get = new htmldb_Get(null,4500,'INTERNAL_APPLICATION_PROCESS=172369000165936003',0); get.add('P145_FK_REF_TABLE', toTable ); get.add('P145_TO_COLS', toCols ); get.add('P145_FROM_COLS', fromCols ); get.add('P145_FK_NAME', fkName ); get.add('P145_FK_ACTION', fkAction ); var ret = get.get(); if (ret.indexOf('HTMLDB:ERROR') > 0) { html_GetElement('htmldbMessageHolder').innerHTML = ret; } else { html_GetElement('htmldbNewTable').parentNode.innerHTML = ret; html_GetElement('P145_FK_REF_TABLE').value = ''; html_GetElement('P145_FK_REF_COLUMN_SEL').options.length = 0; // html_GetElement('P145_FK_THIS_COLUMN_SEL').options.length = 0; g_fkCount += 1; html_GetElement('P145_FK_NAME').value = html_GetElement('P145_TABLE_NAME').value+'_fk'+g_fkCount; html_HideItemRow('P145_FK_REF_COLUMN'); html_HideItemRow('P145_FK_REF_COLUMN_SEL'); //html_GetElement('htmldbMessageHolder').innerHTML = ''; html_RemoveAllChildren('htmldbMessageHolder'); Shuttle.reset(); } var foo = ''; } function ob_rmFkRow(rowId) { var get = new htmldb_Get(null,4500,'INTERNAL_APPLICATION_PROCESS=172867829404455433',0); get.add('P145_FK_SEQ', rowId ); var ret = get.get(); x = html_GetElement('fkTab_'+rowId); x.parentNode.removeChild(x); } function ob_addCons() { // const name var conName = html_GetElement('P149_NAME').value; // unique columns var uCols = ob_getOpts('P149_SEL_COLS'); // check constraints var chkCons = html_GetElement('P149_CHECK').value; // cons type var consType = html_RadioValue('P149_CONST_TYPE'); var get = new htmldb_Get(null,4500,'INTERNAL_APPLICATION_PROCESS=176127519858657209',0); get.add('P149_NAME', conName ); get.add('P149_SEL_COLS', uCols ); get.add('P149_CHECK', chkCons ); get.add('P149_CONST_TYPE', consType ); var ret = get.get(); if (ret.indexOf('HTMLDB:ERROR') > 0) { html_GetElement('htmldbMessageHolder').innerHTML = ret; } else { html_GetElement('htmldbNewTable').parentNode.innerHTML = ret; html_GetElement('P149_CHECK').value = ''; html_GetElement('P149_SEL_COLS').options.length = 0; if ( consType == 'C' ) { g_conCount += 1; html_GetElement('P149_NAME').value = html_GetElement('P149_TABLE_NAME').value+'_ck'+g_conCount; } else { g_ukCount += 1; html_GetElement('P149_NAME').value = html_GetElement('P149_TABLE_NAME').value+'_uk'+g_ukCount; } html_GetElement('htmldbMessageHolder').innerHTML = ''; Shuttle.reset(); } } function ob_rmConsRow(rowId) { var get = new htmldb_Get(null,4500,'INTERNAL_APPLICATION_PROCESS=176138206577719675',0); get.add('P149_CONS_SEQ', rowId ); var ret = get.get(); x = html_GetElement('consTab_'+rowId); x.parentNode.removeChild(x); } var gLastFilteredKey; function ob_DelayTableSearch(e){ gLastFilteredKey=new Date(); setTimeout(delayedFilter,250); } function delayedFilter(){ if (((new Date() - gLastFilteredKey )) > 250 ) { ob_createTableFKCols(); }else{ setTimeout(delayedFilter,250); } } function p149_RadioTog(){ var curVal = html_RadioValue('P149_CONST_TYPE') ; if (curVal == 'C') { html_ShowItemRow('P149_CHECK'); html_HideItemRow('P149_AVAIL_COLS'); html_HideItemRow('P149_SEL_COLS'); html_GetElement('P149_NAME').value = html_GetElement('P149_TABLE_NAME').value+'_ck'+g_conCount; } else { html_HideItemRow('P149_CHECK'); html_ShowItemRow('P149_AVAIL_COLS'); html_ShowItemRow('P149_SEL_COLS'); html_GetElement('P149_NAME').value = html_GetElement('P149_TABLE_NAME').value+'_uk'+g_ukCount; } } function ob_ToggleNN(obj) { var l_NextSib = obj.nextSibling; if(l_NextSib != null && l_NextSib.nodeType == 3){l_NextSib = l_NextSib.nextSibling}; if (obj.checked==true) { obj.value = 'Y'; l_NextSib.value = 'Y'; } else { obj.value = 'N'; l_NextSib.value = 'N'; } } function ob_table_getColOrder(){ var l_item = html_GetElement("P602_COL_ORDER"); var lTable = html_CascadeUpTill(html_GetElement("htmldbNewTable"),"TABLE"); var l_Inputs = lTable.getElementsByTagName('input'); var i=0; var ret=""; for(i=0;i