Hi,

it is a sub-function an I get a string, I dont select it from a table. Our
customer should not use the * in the id, but he did. In the interface to the
cheer is set to it with filling *.

Thank you

-----Ursprüngliche Nachricht-----
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 10:09
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] string difficulty

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_m...@satron.de [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
>
> 


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item on the
main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at
http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links



  • [firebird... 'checkmail' check_m...@satron.de [firebird-support]
    • Re: ... Virna Constantin costel...@yahoo.com [firebird-support]
      • ... 'checkmail' check_m...@satron.de [firebird-support]
    • Re: ... Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
      • ... 'checkmail' check_m...@satron.de [firebird-support]

Reply via email to