[egenix-users] String or binary data would be truncated

Programmer programmer at paradigm-corp.com
Tue Mar 6 14:35:01 CET 2007


Here's the trace:
Traceback (innermost last): 

*	Module ZPublisher.Publish, line 115, in publish
*	Module ZPublisher.mapply, line 88, in mapply
*	Module ZPublisher.Publish, line 41, in call_object
*	Module OFS.DTMLMethod, line 144, in __call__
	<DTMLMethod at /ds/diesResponse used for /ds/index_html>
	URL: http://localhost:8080/ds/diesResponse/manage_main
	Physical Path:/ds/diesResponse
*	Module DocumentTemplate.DT_String, line 476, in __call__
*	Module DocumentTemplate.DT_Try, line 140, in render
*	Module DocumentTemplate.DT_Try, line 149, in render_try_except
*	Module DocumentTemplate.DT_Util, line 196, in eval
	__traceback_info__: fileList
*	Module <string>, line 1, in <expression>
*	Module Shared.DC.Scripts.Bindings, line 311, in __call__
*	Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
*	Module Products.PythonScripts.PythonScript, line 325, in _exec
*	Module None, line 7, in dieFiles
	<PythonScript at /dieFiles used for /ds/index_html>
	Line 7
*	Module Shared.DC.ZRDB.DA, line 495, in __call__
	<SQL at /addDieFiles used for /ds/index_html>
*	Module Products.mxODBCZopeDA.ZopeDA, line 1503, in query
*	Module Products.mxODBCZopeDA.ZopeDA, line 1366, in
run_cursor_callback
*	Module Products.mxODBCZopeDA.ZopeDA, line 1502, in <lambda>
*	Module Products.mxODBCZopeDA.ZopeDA, line 999, in errorhandler

Warning: ('22001', 8152, '[Microsoft][ODBC SQL Server Driver][SQL
Server]String or binary data would be truncated.', 6113)
 
Here is the script dieFiles:
 
parameters = files, dieID 
sqlMethod = context.addDieFiles
f = str(files).split(',')
 
if files is not None:
    for j in f:
        sqlMethod(ID=dieID, fname=str(j))
 
The form allows the user to select a single file for the "order form".
This filename goes into the Dies table. At the bottom of the form the
user can select several files for "art work" and these filenames are
then inserted into the dieFiles table which is FKed to the Dies table.
In my tests the insert is successful if I choose an order form and not
an art work file. I thought I was having one of those Zope errors due to
the format of the values. These look as such:
 
order_form value - 	'C:\\Documents and Settings\\Programmer\\My
Documents\\Code\\blinkingBox.txt'
fileList value with one file selected - 	'C:\\Documents and
Settings\\Programmer\\My Documents\\Code\\copyFields.txt'
fileList value with multiple files - 	['C:\\Documents and
Settings\\Programmer\\My Documents\\Code\\caveman.txt', 'C:\\Documents
and Settings\\Programmer\\My Documents\\Code\\CATEGORY.txt']
 
As you can see the fileList value with one file selected is the same as
from order_form which does insert successfully on it's own. What gives
here?
Is this a freak of nature? A SQL Server hiccup? my sloppy code? or
mxODBCZopeDA.ZopeDA? help!
 
 Zope 2.9.6
Python 2.4.3
XP Pro
mxODBCZopeDA-1.0.10
SQL Server 2K
 
M. A. Ruberto (Programmer)
Every piece of knowledge must have a single, unambiguous, authoritative
representation within a system.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman-archives/egenix-users/attachments/20070306/4d28999a/attachment.htm


More information about the egenix-users mailing list