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.
Hi,
When using the following the trailing spaces are not removed from
the string. Why does this not work properly?
$ userid=$(echo "select trim(trailing ' ' from userid) as userid from
table where userid = 'a1abcdef'" | dbaccess $DB 2>/dev/null | grep -vi
user | sort -nr)
$ echo "[${userid}]"
[a1abcdef ]
^^^^The spaces have not been trimmed in the result.
Regards,
Jeff
↪ replying to JeffC
John Carlson — — source: Usenet: comp.databases.informix
On 19 Jun 2003 08:25:15 -0700, gninnacj@netscape.net (JeffC) wrote:
What happens when you run the SELECT in dbaccess?
such as . . .
select "*"||trim(trailing ' ' from userid)||"*"
from table
where userid = 'a1abcdef'
>Hi,
>
>When using the following the trailing spaces are not removed from
>the string. Why does this not work properly?
>
>$ userid=$(echo "select trim(trailing ' ' from userid) as userid from
>table where userid = 'a1abcdef'" | dbaccess $DB 2>/dev/null | grep -vi
>user | sort -nr)
>$ echo "[${userid}]"
>[a1abcdef ]
> ^^^^>The spaces have not been trimmed in the result.
>
>Regards,
>Jeff
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.