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.
Pietje Puk (Alex Bernaards) asked for an Informix equivalent of Convert(char, col) on version 7.24, moving to 7.31. Sergey E. Volkov said IDS 9.x supports col::char(10) and earlier versions do not. Art S. Kagel advised that Informix converts fetched columns automatically to the host variable type in ESQL/C, 4GL or CLI, giving a -12xx error only for non-numeric data.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Pietje Puk — — source: Informix-list mailing list archive (1991-1998)
Hi,
I want to convert a character field to numeric.
For Micrsoft or Sybase SQL server v6.5 the select statement is:
Convert(char,Tablename.Customer_ID)
Does Informix have something like that?
Thanks in advance
Alex
↪ replying to Pietje Puk
Sergey E. Volkov — — source: Informix-list mailing list archive (1991-1998)
Depends on version of IDS.
For example for IDS-9.x
tablename.customer_id::char(10) -- ala c++
In earlier versions of IDS this isn't supported.
Pietje Puk <Pietje@puk.com> ''''' '
''''''''':3a028dde$0$25544@news2.zeelandnet.nl...
> Hi,
>
> I want to convert a character field to numeric.
>
> For Micrsoft or Sybase SQL server v6.5 the select statement is:
> Convert(char,Tablename.Customer_ID)
>
> Does Informix have something like that?
>
> Thanks in advance
>
> Alex
>
>
>
↪ replying to Sergey E. Volkov
Alex Bernaards — — source: Informix-list mailing list archive (1991-1998)
Working on 7.24, switching to 7.31 in a couple of weeks.
So, does 7.31 support this?
Alex
"Sergey E. Volkov" wrote:
> Depends on version of IDS.
> For example for IDS-9.x
>
> tablename.customer_id::char(10) -- ala c++
>
> In earlier versions of IDS this isn't supported.
>
> Pietje Puk <Pietje@puk.com> ÐÉÛÅÔ ×
> ÓÏÏÂÝÅÎÉÉ:3a028dde$0$25544@news2.zeelandnet.nl...
> > Hi,
> >
> > I want to convert a character field to numeric.
> >
> > For Micrsoft or Sybase SQL server v6.5 the select statement is:
> > Convert(char,Tablename.Customer_ID)
> >
> > Does Informix have something like that?
> >
> > Thanks in advance
> >
> > Alex
> >
> >
> >
↪ replying to Alex Bernaards
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
What are you using for a front-end? Know that Informix automatically
converts fetched columns to match the type of the corresponding host/bind
variable if possible. So if you want to fetch that char column into a
numeric host var in ESQL/C, 4GL, or CLI just do it. If it cannot be done,
ie a row contains a non-numeric value, you will get a -12xx error code.
Art S. Kagel
Alex Bernaards wrote:
>
> Working on 7.24, switching to 7.31 in a couple of weeks.
>
> So, does 7.31 support this?
>
> Alex
>
> "Sergey E. Volkov" wrote:
>
> > Depends on version of IDS.
> > For example for IDS-9.x
> >
> > tablename.customer_id::char(10) -- ala c++
> >
> > In earlier versions of IDS this isn't supported.
> >
> > Pietje Puk <Pietje@puk.com> ÐÉÛÅÔ ×
> > ÓÏÏÂÝÅÎÉÉ:3a028dde$0$25544@news2.zeelandnet.nl...
> > > Hi,
> > >
> > > I want to convert a character field to numeric.
> > >
> > > For Micrsoft or Sybase SQL server v6.5 the select statement is:
> > > Convert(char,Tablename.Customer_ID)
> > >
> > > Does Informix have something like that?
> > >
> > > Thanks in advance
> > >
> > > Alex
> > >
> > >
> > >
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.