From d706cdae2ddee0cc7d461825f76ca62abd1cf301 Mon Sep 17 00:00:00 2001
From: gakin <gakin>
Date: Thu, 17 Mar 2016 13:00:00 +0000
Subject: [PATCH] SSDM-3309 : bug in automatic code generation with batch
 upload

SVN: 35929
---
 .../generic/server/business/bo/SampleCodeGeneratorByType.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java
index 749657cde6e..5e4b2333b99 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java
@@ -33,7 +33,7 @@ public class SampleCodeGeneratorByType extends EntityCodeGenerator
     public static interface MaxQuery extends BaseQuery
     {
         @Select(sql = "SELECT max(substr(code, length(?{1})+1)::int) "
-                + "FROM samples_all WHERE code similar to ?{1} || '[1234567890]+'")
+                + "FROM samples_all WHERE UPPER(code) similar to UPPER(?{1}) || '[1234567890]+'")
         public int getMaxCode(String prefix);
     }
 
-- 
GitLab