Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2002
    Location
    Bielefeld, Germany
    Posts
    69

    Unanswered: Ingres CAST Syntax?

    Hi all!
    I need to typecast an char(12) field to int on an Ingres DB via IngresII ODBC driver. I keep getting "CAST is not a function" errors. My google-fu fails me and I don't have any documentation at hand.
    To provide some background: There is a table with a field "ID" that only contains numerical values, but the type is char(12) (no way for me to change that, duh). I need to find out the highest value, but MAX(ID) returns the highest value ordered lexically :/

  2. #2
    Join Date
    Jul 2003
    Location
    England
    Posts
    152
    you could try to convert by using int4(field) - this should convert the char to an integer value.
    Regards
    Dbabren

  3. #3
    Join Date
    Nov 2002
    Posts
    33
    As dbabren says max(int4(id)) is what you want. Also the docs are online in PDF format here ftp://ftp.ca.com/pub/ingres/docs/

    HTH
    Paul
    Paul Mason

  4. #4
    Join Date
    Mar 2002
    Location
    Bielefeld, Germany
    Posts
    69

    Thank you both!

    That's it
    And thanks for the link, I'm sure that'' come in handy soon.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •