Posts

Oracle Updagte if Exhist else Insert

merge into A outl   using (select 1 id, 'A' ran,3 beat from dual) s   on (outl.ID = s.id and outl.RANG=s.ran )   when matched then update set BEAT = s.beat   when not matched then insert (ID, RANG,BEAT)    values ( s.id , s.ran,s.beat);

Bootstrap DatTimePicker set Current Date

Image
Hi I had to set the current date for BootStrap Date Time Picker in YYYY-MM-DD formet Given code assist me to do it . JS          $('#date').datetimepicker({             pickDate: true,             pickTime: false,                   });       //After create control         var dNow = new Date();         var localdate = dNow.getFullYear()+'-'+ (dNow.getMonth() + 1) + '-' + dNow.getDate() ;          $('#datet').val(localdate); HTML     <div class='input-group date' id='date' value="" data-date-format="YYYY-MM-DD">                                 <input type='text'  id="datet" name="datet" />                 ...

PHP Write Echo content to file

You can get the echo content to variable as fallows ob_start (); echo '<html>' ; echo '<div>' ; echo 'TEST PRINT' ; echo '</div>' ; echo '</html>' ; $content = ob_get_clean (); Write the echo content to file can achieve as fallows $fp = fopen ( $_SERVER [ 'DOCUMENT_ROOT' ] . "/test . html" , "wb" ); fwrite ( $fp , $content ); fclose ( $fp );

behind the times: 10 Tips to Increase IntelliJ IDEA Performance

behind the times: 10 Tips to Increase IntelliJ IDEA Performance

ORACLE unique constraint (%s.%s) violated

Image
I fase following error number of time when I try to insert a set of rows to a table where primary key got changed . ORA-00001: unique constraint ( ATTRIBUTE_PK) violated When I re run the quary in SQL developer I got more information as below. SQL Error: ORA-00001: unique constraint (ATTRIBUTE_PK) violated 00001. 00000 -  "unique constraint (%s.%s) violated" *Cause:    An UPDATE or INSERT statement attempted to insert a duplicate key.            For Trusted Oracle configured in DBMS MAC mode, you may see            this message if a duplicate entry exists at a different level. *Action:   Either remove the unique restriction or do not insert the key. When I'm searching   it on the google I got the follwing , give me a hint  Oracle Reference Documents   http://oraref.tistory.com/entry/ORA-00001-unique-constraint-ss-violated I found that there is a inde...

Excel PDF CSV Export for jQuery Datatable

Image
The Jquery Data-table has PDF ,CSV ,Excel support which  reduce lot of cording by integrating other open source libraries .  https://datatables.net/extensions/buttons/examples/initialisation/export.html Here I have indicated step by step guide for the integration . Step 1 . JS Imports  dataTables.buttons.min.js  //Provided in \DataTables-1.10.13\extensions\Buttons buttons.flash.min.js            //Provided in \DataTables-1.10.13\extensions\Buttons buttons.html5.min.js          //Provided in \DataTables-1.10.13\extensions\Buttons buttons.print.min.js           //Provided in \DataTables-1.10.13\extensions\Buttons jszip.min.js                       //Please download from http://stuk.github.io/jszip/ pdfmake.min.js                //Please Download from...

DataTables warning: table id=table - Cannot reinitialise DataTable. For more information about this error,

I have gone trough following error number of time when I'm using Jquery Data table. DataTables warning: table id=table - Cannot reinitialise DataTable. For more information about this error,  I have a combo box in the page which lead re bind the Jquary Datatable ,while  table is already bind with data. Flowing solutions are possible to resolve the issue. Destroy the table before re bind it . $("#table").dataTable().fnDestroy();  If condition                                    if ( $.fn.dataTable.isDataTable('#table') ) { table = $('#table').DataTable(); } else { table = $('#table').DataTable( { } );