Monday, November 18, 2013

How to insert a text every x rows in Notepad++?

Google search brought me to How to insert a line break every 5 rows in Excel/Word/Notepad++?

Using the suggested regex from the above source, replace the number 5 with x and replace \n with any text.

For example, to insert a commit; after every 100 lines in a sql script. This would be the regex -

Find       : ((.*\s*\n\s*){100})
Replace : $1commit;\n


Excel: Copy formula to tens of thousands of rows

Check the Quickly Copy Excel Formula Down to achieve it.

Note that it only works if there is data in the adjacent column only. So if the data is on column A and formula to be copied is on column C, then it will NOT work. The formula to be copied has to be on column B.



User names and tablespace names


Select all schema user names
select username from dba_users;


Select all tablespace names
select tablespace_name from dba_tablespaces;


Create a simple tablespace
CREATE TABLESPACE POOL_TS
  DATAFILE 'pool_ts.dat'
  SIZE 20M AUTOEXTEND ON;

Sunday, November 10, 2013

Your Message Wasn’t Delivered Because Of Security Policies

Java Mail API can be used to send emails. For a mail to be sent, at the minimum the following need to present -
  • Mail Server Host and Port [Mandatory]
  • Sender email id [Optional, can be a dummy mail id]
  • Receiver email id [Mandatory]
If the mail server is Microsoft Exchange, there could be a policy that requires sender authentication. It means that sender also needs to be a valid authenticated user. If a dummy mail id is used as sender, then MS Exchange would not let the mail be delivered.

In that event, the following articles explain how that can be disabled.

Note that the above settings need to be performed on the MS Exchange Mail Server. If MS Exchange Mail server cannot be accessed, then a valid sender needs to be used!

Dual label header cell split diagonally

Simple instructions to create Split cell diagonal. The article starts with angled text; scroll down a little bit.

Microsoft Excel - How to create a combination chart of Bar & Line and Secondary axis

Official Microsoft guide to Present your data in a combination chart

By default, there is only one vertical or horizontal axis called the Primary axes. One can Add or remove a secondary axis in a chart should you require it.

Friday, November 1, 2013

Oracle append string to select query


Append in a select statement can be achieved via the || operator.

select 'Mr.' || name from employee e where e.sex = 'M'

select case when e.sex = 'M' then 'Mr.' else 'Ms.' end || name as salutation_name from employee e