On 3?29?, ??8?07?, waw...@hotmail.com (Randy K) wrote:
> Beginer's question.
>
> I have a view where I'm concatenating the lating names for genus and
> species to create a virtual field named Scientific_Name. Because the
> latin name is defined as 40 characters the resulting virtual field is
> 80. Is there a way to define the virtual filed to 50 for example?
> I'm not worry about the concatenated string being longer than 50.
>
> CREATE view v_TAXO_SciName as
> select
> T1.TAXO_NAME_Id,
> T1.Primary_Common_Name as Common_Name,
> case
> when T1.TAXO_CATGRY_TYPE_Code = 70 then T3.Latin_Name + ' ' +
> T2.Latin_Name + ' ' + T1.Latin_Name
> when T1.TAXO_CATGRY_TYPE_Code = 60 then T3.Latin_Name + ' ' +
> T2.Latin_Name
> end 'Scientific_Name',
> T4.latin_name as Class_Name,
> T1.TAXO_CATGRY_TYPE_Code
> from
> TAXO_NAME T1,
> TAXO_MGMNT_LEVEL L,
> TAXO_NAME T2,
> TAXO_NAME T3,
> TAXO_NAME T4
> where
> T1.TAXO_NAME_Id = L.TAXO_NAME_Id
> and L.Species_Num =T2.TAXO_NAME_Id
> and L.Genus_Num =T3.TAXO_NAME_Id
> and L.Class_Num =T4.TAXO_NAME_Id
> and (T1.TAXO_CATGRY_TYPE_Code = 70 or T1.TAXO_CATGRY_TYPE_Code = 60)
you can use LEFT function for specified length.