Menu

Maximum integer value exceeded.

Paulino
2006-10-02
2013-04-29
  • Paulino

    Paulino - 2006-10-02

    When querying a table I got this error message:

    File "C:\Python24\Lib\site-packages\pymssql.py", line 146, in executemany
    raise DatabaseError, "internal error: %s (%s)" % (self.__source.errmsg(), self.__source.stdmsg())
    pymssql.DatabaseError: internal error: SQL Server message 248, severity 16, state 1, line 1:
    The conversion of the varchar value '2745112301 ' overflowed an int column. Maximum integer value exceeded.
    DB-Lib error message 10007, severity 5:
    General SQL Server error: Check messages from the SQL Server.
    (SQL Server message 248, severity 16, state 1, line 1:
    The conversion of the varchar value '2745112301 ' overflowed an int column. Maximum integer value exceeded.
    DB-Lib error message 10007, severity 5:
    General SQL Server error: Check messages from the SQL Server.

    The column where that value is in, is defined as string, not as integral; that column is in the query in the 'WHERE' clause, so I don't need this value to be treated as as integer.

    Any clue??

     
    • A

      A - 2006-10-02

      Please tell what pymssql version do you use?
      What version of ntwdblib.dll do you have on PC (find them all, the most obvious place is %WINDIR%\system32).

       
    • Paulino

      Paulino - 2006-10-03

      The same problem happens with pymssql 0.74 and 0.80.

      The ntwdblib version is 2000.80.194.0

       
    • A

      A - 2006-10-03

      I can see a space at the end of the string rep of the number: '2745112301 '; that may be a problem. Could you post the query or send me it in priv?

       
    • Paulino

      Paulino - 2006-10-04

      the field length is 25 chars when the values don't reach that length the field is filled with spaces.

      here's the query:

      ano=2005     #input( 'Exercício: ')
      conta='642212'       #raw_input('Conta contabilistica: ')
      ccusto='1201'         #raw_input('Centro de Custo: ')

      ordem = " SELECT L.t_fyer, L.t_fprd, L.t_dcdt, L.t_otyp, L.t_odoc, L.t_suno, D.t_bref, L.t_dbcr, \
          L.t_amnt \
      FROM ttfgld106100 L, ttfgld100100 D \
      WHERE L.t_oyer=D.t_year AND L.t_obat=D.t_btno AND \
          L.t_fyer="+str(ano)+" AND L.t_leac=" +conta+"AND L.t_dim5=" +ccusto+"\
      ORDER BY L.t_fprd ASC" 

      cur.execute(ordem)

       
      • A

        A - 2006-10-05

        Try this:
        ordem = " SELECT L.t_fyer, L.t_fprd, L.t_dcdt, L.t_otyp, L.t_odoc, L.t_suno,
        D.t_bref, L.t_dbcr, \
           L.t_amnt \
        FROM ttfgld106100 L, ttfgld100100 D \
        WHERE L.t_oyer=D.t_year AND L.t_obat=D.t_btno AND \
           L.t_fyer='"+str(ano)+"' AND L.t_leac='" +conta+"' AND L.t_dim5=" +ccusto+"\
        ORDER BY L.t_fprd ASC"

         
    • Paulino

      Paulino - 2006-10-04

      Well the number: '2745112301 ' is in the field 'L.t_leac'

       

Log in to post a comment.