Tuesday, May 31, 2011

Trick to remove Blank lines in Text

1. copy the content to MS Word
2. Find: ^p^p
Replace: ^p

FYI: If we have complex blank lines the below procedure can help

There may be spaces and tabs that interfere with a normal ^p^p find/replace operation. If tabs and double spaces are not required by the other entries, I suggest this:

Find: ^t
Replace: (space)

Find: (space)(space)
Replace: (space)
(and do this until the find count is 0; remember to save the document every time)

Find: ^l
Replace: ^p

Find: ^p(space)
Replace: ^p
(do this until the find count is 0)

Find: (space)^p
Replace: ^p
(do this until the find count is 0)

Find: ^p^p
Replace: ^p
(do this until you're happy with the result)

Wednesday, May 25, 2011

Restrictions on ROWNUM in SQL

We can't use ROWNUM in a query with greater than condition.

For Example, we have below queries.

SELECT * FROM EMPTABLE WHERE ROWNUM > 100

output: 0 rows returned.

SELECT * FROM EMPTABLE WHERE ROWNUM < 100

output: it returns all 100 rows.

It is because rownum is a dymanic number generated and assigned to the rows while fetching the data from database. which is something like counting from 1,2..... It can't read which is 100th row unless it knows previous rows starting from 1. Hence it doesn't work with greater than (>) condition.

Wednesday, May 18, 2011

Change the file name

Refer the below link:

Please note that this can be used only for the filenames without space in it.

Tuesday, May 10, 2011

Dealing with Time Stamp in XML Files

If you are using Time Stamp in XML Files and XML file is being generated by Application Engine (AE), then you may probably get some issue with the time part of the timestamp. The output will show only 12 Hr insted of 24 Hr value. To nullify this issue, syntax like below.

Let us suppose the data in DB is: 01-jan-2011 14:20:23

DateTimeToLocalizedString(FIELD_TIMESTAMP,'hh:mm:ss'); will give output as : 02:20:23
DateTimeToLocalizedString(FIELD_TIMESTAMP,'HH:MM:SS'); will give output as : 14:20:23

Use upper case always to avoid surprises.