Subject | Re: [firebird-support] string difficulty |
---|---|
Author | Alan J Davies |
Post date | 2015-12-07T09:09:19Z |
Hi, using your code, how about left(:str, position('**' in :str)-1));
select left(:str, position('**' in :str)-1)) from yourtable
However, to make things easier for future users, think about changing
the single '*' to e.g. '-' and then you can keep your existing select
statements and not have this problem when a new ABC*DEFG********01
becomes ABC*DEFGHIJKLMN*01
Alan J Davies
Aldis
On 07/12/2015 08:29, 'checkmail' check_mail@... [firebird-support]
wrote:
select left(:str, position('**' in :str)-1)) from yourtable
However, to make things easier for future users, think about changing
the single '*' to e.g. '-' and then you can keep your existing select
statements and not have this problem when a new ABC*DEFG********01
becomes ABC*DEFGHIJKLMN*01
Alan J Davies
Aldis
On 07/12/2015 08:29, 'checkmail' check_mail@... [firebird-support]
wrote:
> Hello @ll,
>
> I have an input string ABCDEFG, filled with * to 16 chars,
> ABCDEFG*********, followed with zwo digits, f. e. 01
>
> ABCDEFG*********01
>
> 01 can I cut for an other function, now I have ABCDEFG*********
>
> The filled * I can delete for my real ID (ABCDEFG)
>
> left(:str, position('*' in :str)-1));
>
> It works find, but there are IDs available with * in the middle of the
> ID LFor example ABC*DEFG and I receive this: ABC*DEFG********01
>
> In this case the function will return ABC
>
> How can I get ABC*DEFG, leave the * between C*D, delete all * from right?
>
> Thank you.
>
> Best regards
>
> Olaf
>
>