Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Lightbulb Unanswered: Implicit Conversion behavior ASE12.5

    Dear All,

    I found the following issue in Sybase ASE 12.5.

    Assume that the table Test contains the following Schema

    Col1 char(5),
    Col2 int

    I am trying to execute the following query in Sybase SQL Anywhere, MSSQL, Oracle, Sybase ASE12.5,

    I found the following error in Sybase ASE 12.5.

    SQL Statement:

    Select *
    From Test
    Where Col2 = '100'

    Actually the column Col2 data type is int, If i am trying to pass the character type of data what will be happend.

    Sybase SQL AnyWhere - Excutes fine, Returns appropriate result set.

    MSSQL - Excutes fine, Returns appropriate result set.

    Oracle - Excutes fine, Returns appropriate result set.

    Sybase ASE 12.5 - Its not executing the above query, It raise the
    following exception. Implicit conversion
    from datatype 'VARCHAR' to 'INT' is not allowed.
    Use the CONVERT function to run this query.


  2. #2
    Join Date
    Sep 2004
    Stockholm, Sweden
    well, since you are comparing an int to a varchar, you need to convert explicitly:

    convert(int, '100')


Posting Permissions

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