function charindex
Posted in 2012
A DBA on IDS 11.50 (AIX 5.3) asked whether an existing procedure could give the functionality of CHARINDEX, which is a built-in only from 11.70, since upgrading wasn't an option. Jonathan Leffler initially misread the question (thinking CHARINDEX had been dropped) and Art Kagel clarified that it is new in 11.70. Fernando Nunes said such a function is trivial to write as a C UDR but awkward and inefficient in SPL (no loop over a variable position), and offered to supply a C version at the asker's own risk. No ready-made solution or confirmed outcome is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Does anyone know of a procedure that gives similar functionality of the charindex function in earlier informix versions .. ie. 11.50. Have the need for this and don't want to recreate if at all possible...and moving to 11.70 isn't an option just yet on this server.... IDS 11.50.fc7 Aix 5.3 Peter Logan Senior Database Administrator Phone: 616/878-8309
On Fri, Jan 13, 2012 at 06:02, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > Does anyone know of a procedure that gives similar functionality of the > charindex function in earlier informix versions .. ie. 11.50. Have the > need for this and don't want to recreate if at all possible...and moving > to 11.70 isn't an option just yet on this server.... > > IDS 11.50.fc7 > AIX 5.3 > I don't believe CHARINDEX was ever a built-in function - it would not have been dropped in 11.50. Are you sure it wasn't a UDR of some sort? -- Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." --e89a8f2343df8789e104b66a76bc
from what I understand it's new in 11.70 Peter Logan Senior Database Administrator Phone: 616/878-8309 From: "Jonathan Leffler" <jonathan.leffler@gmail.com> To: ids@iiug.org Date: 01/13/2012 10:25 AM Subject: Re: function charindex [25923] Sent by: ids-bounces@iiug.org On Fri, Jan 13, 2012 at 06:02, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > Does anyone know of a procedure that gives similar functionality of the > charindex function in earlier informix versions .. ie. 11.50. Have the > need for this and don't want to recreate if at all possible...and moving > to 11.70 isn't an option just yet on this server.... > > IDS 11.50.fc7 > AIX 5.3 > I don't believe CHARINDEX was ever a built-in function - it would not have been dropped in 11.50. Are you sure it wasn't a UDR of some sort? -- Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." --e89a8f2343df8789e104b66a76bc ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
CharIndex would be trivial to create in C. I think it's harder and much less efficient to create it in SPL because it will not allow a loop with a variable to get the position... I may be wrong... If you don't get a solution I should be able to provide you with a C function... But you'd have to assume responsibility for it's use :) Regards On Fri, Jan 13, 2012 at 3:42 PM, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > from what I understand it's new in 11.70 > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > From: "Jonathan Leffler" <jonathan.leffler@gmail.com> > To: ids@iiug.org > Date: 01/13/2012 10:25 AM > Subject: Re: function charindex [25923] > Sent by: ids-bounces@iiug.org > > On Fri, Jan 13, 2012 at 06:02, Peter_Logan@spartanstores.com < > Peter_Logan@spartanstores.com> wrote: > > > Does anyone know of a procedure that gives similar functionality of the > > charindex function in earlier informix versions .. ie. 11.50. Have the > > need for this and don't want to recreate if at all possible...and moving > > > to 11.70 isn't an option just yet on this server.... > > > > IDS 11.50.fc7 > > AIX 5.3 > > > > I don't believe CHARINDEX was ever a built-in function - it would not have > > been dropped in 11.50. > > Are you sure it wasn't a UDR of some sort? > > -- > Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> > Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org > "Blessed are we who can laugh at ourselves, for we shall never cease to be > > amused." > > --e89a8f2343df8789e104b66a76bc > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --20cf3063e337a1611804b66ad607
No, Jonathan, you read Peter's difficult syntax backwards. CHARINDEX is a * new* built-in function in 11.70 and Peter wants to know if there was anything like it available to 11.50 so he doesn't have to write it since he can't upgrade in any kind of real-time. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jan 13, 2012 at 10:24 AM, Jonathan Leffler < jonathan.leffler@gmail.com> wrote: > On Fri, Jan 13, 2012 at 06:02, Peter_Logan@spartanstores.com < > Peter_Logan@spartanstores.com> wrote: > > > Does anyone know of a procedure that gives similar functionality of the > > charindex function in earlier informix versions .. ie. 11.50. Have the > > need for this and don't want to recreate if at all possible...and moving > > to 11.70 isn't an option just yet on this server.... > > > > IDS 11.50.fc7 > > AIX 5.3 > > > > I don't believe CHARINDEX was ever a built-in function - it would not have > been dropped in 11.50. > > Are you sure it wasn't a UDR of some sort? > > -- > Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> > Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org > "Blessed are we who can laugh at ourselves, for we shall never cease to be > amused." > > --e89a8f2343df8789e104b66a76bc > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae93403d96a179b04b66ad952
oops .. didn't realize I wrote it backwards .. Thanks for clarifying that Art... Peter Logan Senior Database Administrator Phone: 616/878-8309 From: "Art Kagel" <art.kagel@gmail.com> To: ids@iiug.org Date: 01/13/2012 10:53 AM Subject: Re: function charindex [25928] Sent by: ids-bounces@iiug.org No, Jonathan, you read Peter's difficult syntax backwards. CHARINDEX is a * new* built-in function in 11.70 and Peter wants to know if there was anything like it available to 11.50 so he doesn't have to write it since he can't upgrade in any kind of real-time. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jan 13, 2012 at 10:24 AM, Jonathan Leffler < jonathan.leffler@gmail.com> wrote: > On Fri, Jan 13, 2012 at 06:02, Peter_Logan@spartanstores.com < > Peter_Logan@spartanstores.com> wrote: > > > Does anyone know of a procedure that gives similar functionality of the > > charindex function in earlier informix versions .. ie. 11.50. Have the > > need for this and don't want to recreate if at all possible...and moving > > to 11.70 isn't an option just yet on this server.... > > > > IDS 11.50.fc7 > > AIX 5.3 > > > > I don't believe CHARINDEX was ever a built-in function - it would not have > been dropped in 11.50. > > Are you sure it wasn't a UDR of some sort? > > -- > Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> > Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org > "Blessed are we who can laugh at ourselves, for we shall never cease to be > amused." > > --e89a8f2343df8789e104b66a76bc > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae93403d96a179b04b66ad952 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
You didn't write it backwards, just awkwardly. Being a stubborn cuss who is fond of compound complex sentences and the victim of English teachers who couldn't correctly parse those sentences that were not simple, I read it correctly. Jonathan just missed it. ;-) Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jan 13, 2012 at 10:55 AM, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > oops .. didn't realize I wrote it backwards .. Thanks for clarifying that > Art... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > From: "Art Kagel" <art.kagel@gmail.com> > To: ids@iiug.org > Date: 01/13/2012 10:53 AM > Subject: Re: function charindex [25928] > Sent by: ids-bounces@iiug.org > > No, Jonathan, you read Peter's difficult syntax backwards. CHARINDEX is a > * > new* built-in function in 11.70 and Peter wants to know if there was > anything like it available to 11.50 so he doesn't have to write it since > he > can't upgrade in any kind of real-time. > > Art > > Art S. Kagel > Advanced DataTools (www.advancedatatools.com) > Blog: http://informix-myview.blogspot.com/ > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and do not reflect on my employer, Advanced DataTools, the IIUG, nor any > other organization with which I am associated either explicitly, > implicitly, or by inference. Neither do those opinions reflect those of > other individuals affiliated with any entity with which I am affiliated > nor > those of the entities themselves. > > On Fri, Jan 13, 2012 at 10:24 AM, Jonathan Leffler < > jonathan.leffler@gmail.com> wrote: > > > On Fri, Jan 13, 2012 at 06:02, Peter_Logan@spartanstores.com < > > Peter_Logan@spartanstores.com> wrote: > > > > > Does anyone know of a procedure that gives similar functionality of > the > > > charindex function in earlier informix versions .. ie. 11.50. Have the > > > > need for this and don't want to recreate if at all possible...and > moving > > > to 11.70 isn't an option just yet on this server.... > > > > > > IDS 11.50.fc7 > > > AIX 5.3 > > > > > > > I don't believe CHARINDEX was ever a built-in function - it would not > have > > been dropped in 11.50. > > > > Are you sure it wasn't a UDR of some sort? > > > > -- > > Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> > > Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org > > "Blessed are we who can laugh at ourselves, for we shall never cease to > be > > amused." > > > > --e89a8f2343df8789e104b66a76bc > > > > > > > > > > > ******************************************************************************* > > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > --14dae93403d96a179b04b66ad952 > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae934097da2101504b66af67a