Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A newbie on Informix 7.2 asked for an equivalent of Oracle's SUBSTR to drop the first four characters of a column, and to convert non-alphanumeric characters to hyphens. Jonathan Leffler said Oracle-style functions need 7.3. Mariusz Malogrosz and tommi suggested column[start,end] substrings, and Mariusz used a 4GL loop for replacement. Jim Lowry suggested TRIM. No confirmed outcome.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
l_nadella@yahoo.com — — source: Informix-list mailing list archive (1991-1998)
Hello All
I am a newbie to Informix 7.2 but familiar with Oracle. Is there an
equivalent for SUBSTR function in Informix? I need to trim the first
four characters from the values stored in a column. Also I need to
convert any character which is not alphanumeric(/:, etc.) to a hyphen.
Any Ideas???
Nadella
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
↪ replying to l_nadella@yahoo.com
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
l_nadella@yahoo.com wrote:
> I am a newbie to Informix 7.2 but familiar with Oracle. Is there an
> equivalent for SUBSTR function in Informix? I need to trim the first
> four characters from the values stored in a column. Also I need to
> convert any character which is not alphanumeric(/:, etc.) to a hyphen.
> Any Ideas???
Not in 7.2; you need 7.3 to get the Oracle-style functions.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
↪ replying to l_nadella@yahoo.com
Mariusz Malogrosz — — source: Informix-list mailing list archive (1991-1998)
Select x[5,field lenght] from table ............
Use "[", start position , end position , "]" for substrings
For character replacement I use 4GL ,
for x = 1 to length(char field)
if field[x,x] = "?" then
let field[x,x] = "-"
enf if
enf for
Mariusz
l_nadella@yahoo.com wrote in article <7kp8mh$o0u$1@nnrp1.deja.com>...
> Hello All
> I am a newbie to Informix 7.2 but familiar with Oracle. Is there an
> equivalent for SUBSTR function in Informix? I need to trim the first
> four characters from the values stored in a column. Also I need to
> convert any character which is not alphanumeric(/:, etc.) to a hyphen.
> Any Ideas???
>
> Nadella
↪ replying to Jonathan Leffler
tommi@epgmbh.de — — source: Informix-list mailing list archive (1991-1998)
In article <37705AA2.3F22@earthlink.net>,
Jonathan Leffler <jleffler@earthlink.net> writes:
> l_nadella@yahoo.com wrote:
>
>> I am a newbie to Informix 7.2 but familiar with Oracle. Is there an
>> equivalent for SUBSTR function in Informix? I need to trim the first
>> four characters from the values stored in a column. Also I need to
>> convert any character which is not alphanumeric(/:, etc.) to a hyphen.
>> Any Ideas???
>
> Not in 7.2; you need 7.3 to get the Oracle-style functions.
>
You can do 'select textcolun[1,4] from table' to get the first four characters.
↪ replying to l_nadella@yahoo.com
jim lowry — — source: Informix-list mailing list archive (1991-1998)
l_nadella@yahoo.com wrote:
>
> Hello All
> I am a newbie to Informix 7.2 but familiar with Oracle. Is there an
> equivalent for SUBSTR function in Informix? I need to trim the first
> four characters from the values stored in a column. Also I need to
> convert any character which is not alphanumeric(/:, etc.) to a hyphen.
> Any Ideas???
>
> Nadella
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Use "trim"...
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.