Posts

Showing posts from February, 2017

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" />                                 <span class="input-group-addon"><span></span>                                 </span>                             </div>  

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 index on the table with the same name of the primary key already deleted ,which rise