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.

Monday, December 27, 2010

Difference between Delete, Truncate and Drop

Delete table -- will delete the rows from the table for that session/schema only.
Need to use explicit 'COMMIT' to reflect the changes across the schemas/sessions.

Truncate table -- will delete the rows from the table and an implicit 'COMMIT' command will be executed. Changes will be reflected across the schemas/sessions.


Delete table-- u can use ROLLBACK command to retrieve the deleted records
truncate table -- ROLLBACK can't be used

Delete table -- DML(Data Manipulation Language) Command 
Truncate table-- DDL (Data Definition Language) Command

Delete -- is row by row operation
Truncate -- will delete all the data from table
When ever we have to delete all the data in a table Truncate is suggested over Delete.

Drop will delete table structure also, where as Delete and Truncate will not delete Table structure.

Thursday, October 7, 2010

XML File Error

If you are getting any of the following errors:

"Warning! Report access is not set."
or
"Unsupported output format", Try the following.
When you run the report, give the output Type as Web. That should resolve the issue.

Thursday, September 23, 2010

XML Error when '&' is encountered

If we have the following Characters in Data part of XML File, We will get the following errors: ‘whitespace is not allowed at this location’ or ‘a name was started with an invalid character’. To overcome this error, replace the character with the following strings.