I failed to find the correct function to use, but now I found cast(), and
it seems to work so far.

On Wed Jan 28 2015 at 12:46:28 PM Lukas Eder <[email protected]> wrote:

> Have you tried anything so far? Where did your attempts fail?
>
> 2015-01-28 11:23 GMT+01:00 Gavriel Fleischer <[email protected]>:
>
>> Hi,
>>
>> I have a String field that contains data like: "1;2;3". I built the DSL
>> statement that gets the "2nd subfield" from this string ("2"), but it's
>> still a String, and I need to convert it to  Integer. How can I do this?
>>
>>
>>
>> final Field<Integer> status = decode().when(TABLE.EVENTID.eq("vp1s"), 
>> CsvSplitter.getCsvField(STATISTICSDAILYSUMMARY.EVENTVALUE, ";", 
>> 1).HOW_CAN_I_CONVERT_IT_TO_INTEGER?).otherwise(0);
>>
>>
>> public class CsvSplitter {
>>     public static Field<String> getCsvField(Field<String> field, String 
>> delimiter, int pos);
>> }
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "jOOQ User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jooq-user/BdCCmpl47ws/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to