Administer > Database Administration > Case-sensitivity > JavaScript implications of case-insensitivity

JavaScript/RAD implications of a case-insensitive database environment

In a case-insensitive environment, such as when Service Manager is set up to connect to Microsoft SQL Server with a case-insensitive code page or Oracle with case-insensitive settings, you should be aware that:

  • Only Service Manager queries are evaluated case-insensitively.
  • All Service Manager expressions are still evaluated case-sensitively.
    This includes RAD expressions, JavaScript expressions as well as the expressions within DVD conditions in Service Manager forms.

For example, given a database that contains a contacts record where the actual last.name is stored in the database as "Smith," the following code will successfully select the record but fail the Java Script test:

   var contactList = new SCFile( "contacts" );
   var findContact = contactList.doSelect( "last.name=\"SMITH\"" );
   var lastName = "SMITH";
   if ( lastName == findContact.last_name )	// This expression is evaluated case-sensitively.
   {
      print("Hello!");				// This code will never be executed.
   }

In this example:

  • The query in contactList.doSelect() will be evaluated case-insensitively, therefore findContact will get the record back.
  • All other JavaScript expressions will evaluate case-sensitively. Therefore, statements within the "if" block will never be executed.