23 August 2012

Comparing Strings in SQL Server

If you are trying to compare two strings in a stored procedure or trigger or ... you need to note that you have  to specify the length of the strings before comparison, if you don't do that, you won't get the expected result out of your query. Also remember, it is one equal sign not two like Java.

I am not suggesting to do that, I am looking at DBs as storage for data and to me, all manipulations on data should be exercised on the logic layer of your application.

How to Compare two strings using a if in a stored procedure in sql server 2008?

17 August 2012

Move to the next / previous tab in Eclipse

Have you ever wondered how you can move to the next / previous tab when coding in Eclipse? You might find it very helpful to know that you can do that by using Ctrl + PgUp / PgDn (in windows) for moving to the next or previous tab or by clicking Ctrl + E or Ctrl + F6 for a list of tabs to pop up, then you select which one to show using arrow keys.

More information:
Eclipse HotKey: how to switch between tabs?

3 August 2012

Locale


After a while when you do coding, you become familiar with the concept of Locale. Instinctively it means something local to the user, it's definition is as described below

"These settings usually include the following display (output) format settings:

  • Number format setting
  • Character classification, case conversion settings
  • Date/Time format setting
  • String collation setting
  • Currency format setting
  • Paper size setting
  • Etc ...

The locale settings are about formatting output given a locale. So, the timezone information and daylight saving time are not usually part of the locale settings. Less usual, but worth mentioning, is the input format setting. This is mostly defined on a per application basis."

An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user.