note 56196 modified in function.ociresult by sixd

From: Date: Thu, 08 Oct 2009 19:32:32 +0000
Subject: note 56196 modified in function.ociresult by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-161562@lists.php.net to get a copy of this message
I am trying to get a list of the first character of a character string. SELECT distinct substr(version,1,1) as COL1 FROM SPHVVERS where Version is not null order by 1 This was working and then failed recently. I think it is because some of the strings now added contain a number as the first character. I found to get it to work I had to use decode statement. (To_Char did not work ) SELECT distinct decode (substr(version,1,1),'1','?','0','!',substr(version,1,1)) as COL1 FROM SPHVVERS where Version is not null order by 1 --was-- I am trying to get a list of the first character of a character string. SELECT distinct substr(version,1,1) as COL1 FROM SPHVVERS where Version is not null order by 1 This was working and then failed recently. I think it is because some of the strings now added contain a number as the first character. I found to get it to work I had to use decode statement. (To_Char did not work ) SELECT distinct decode (substr(version,1,1),'1','?','0','!',substr(version,1,1)) as COL1 FROM SPHVVERS where Version is not null order by 1 http://php.net/manual/en/function.ociresult.php

« previous php.notes (#161562) next »