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.
Min Kim asked how to left-align an INT or SMALLINT when concatenating it to a string, because the padding space was unwanted when naming indexes on the fly. Rob Vorbroker suggested USING with a run of < characters, matched to SMALLINT or INTEGER size. Art S. Kagel suggested concatenating a trimmed column with the number in SQL. Min Kim solved it by assigning the INT to a string variable.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Min Kim — — source: Informix-list mailing list archive (1991-1998)
hi,
does anyone know how to align an INT or SMALLINT to the left as far as
possible?
I want to cat a string and an int, but I get results like:
ThisIsMyString 5
The space is undesirable since I'm naming indexes on the fly.
Min
↪ replying to Min Kim
robertb..vorbroker — — source: Informix-list mailing list archive (1991-1998)
LET l_index = "ThisIsMyString", l_int USING "<<<<<"
Number of < depends on whether you are using a SMALLINT or INTEGER...
Rob Vorbroker
Min Kim <mkim@icpma.com> wrote in message
news:374C2801.CC1C41B0@icpma.com...
> hi,
> does anyone know how to align an INT or SMALLINT to the left as far as
> possible?
> I want to cat a string and an int, but I get results like:
> ThisIsMyString 5
> The space is undesirable since I'm naming indexes on the fly.
>
> Min
>
↪ replying to Min Kim
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Min Kim wrote:
>
> hi,
> does anyone know how to align an INT or SMALLINT to the left as far as
> possible?
> I want to cat a string and an int, but I get results like:
> ThisIsMyString 5
> The space is undesirable since I'm naming indexes on the fly.
Are you selecting these from some table? Try concatenation:
SELECT trim(colname) || colno
FROM syscolumns;
Art S. Kagel
↪ replying to Min Kim
Min Kim — — source: Informix-list mailing list archive (1991-1998)
Nevermind on this one. I just assigned the INT to a STRING and all went
well.
Min
Min Kim wrote:
> hi,
> does anyone know how to align an INT or SMALLINT to the left as far as
> possible?
> I want to cat a string and an int, but I get results like:
> ThisIsMyString 5
> The space is undesirable since I'm naming indexes on the fly.
>
> Min
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.