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??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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??
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).
The same problem happens with pymssql 0.74 and 0.80.
The ntwdblib version is 2000.80.194.0
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?
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)
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"
Well the number: '2745112301 ' is in the field 'L.t_leac'