List Info

Thread: no-error error




no-error error
user name
2007-10-19 11:44:30
Hello,
I have a python program that converts some data and writes
it via ODBC driver.
I am using a win32 dbi,odbc to do that. (none of the free
other ones work)

I just upgraded my ODBC driver to a newer version that
supposedly is a
2.0 compatible.

Now I am getting a:
dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC
Driver]String or
binary data would be truncated in EXEC

What I noticed is that dbi.no-error has given me this error.
How do I
except a 'no-error' error?

Lucas


-- 
-- 
Vim auto completion for python
http://lucasmanual.com/mywi
ki/FrontPage#head-8ce19b13e89893059e126b719bebe4ee32fe103c
TurboGears from start to finish:
http://w
ww.lucasmanual.com/mywiki/TurboGears
_______________________________________________
DB-SIG maillist  -  DB-SIGpython.org
http:/
/mail.python.org/mailman/listinfo/db-sig

Re: no-error error
country flaguser name
United States
2007-10-19 13:02:31
Lukasz Szybalski wrote:
> Hello,
> I have a python program that converts some data and
writes it via ODBC driver.
> I am using a win32 dbi,odbc to do that. (none of the
free other ones work)

Did you try http://ceodbc.sourcefor
ge.net  ?

I missed it the first time I went searching for odbc
modules.

When I tried it, I got an error that according to the driver
docs was only 
applicable to the jdbc driver, which I wasn't using.

Turns out the odbc driver had a bug in it, and Anthony
(ceODBC author) responded 
with a workaround (rename my exe to msdev.exe!) within a
day, and within a week 
had a ceODBC update that had a more elegant workaround.  (he
can't fix bugs in 
someone elses odbc driver, so workaround is as good as it
will get)

Carl K
_______________________________________________
DB-SIG maillist  -  DB-SIGpython.org
http:/
/mail.python.org/mailman/listinfo/db-sig

Re: no-error error
user name
2007-10-19 14:02:16
Have you guys ever deal with this error? dbi.no-error?


On 10/19/07, Carl Karsten <carlpersonnelware.com>
wrote:
> Lukasz Szybalski wrote:
> > Hello,
> > I have a python program that converts some data
and writes it via ODBC driver.
> > I am using a win32 dbi,odbc to do that. (none of
the free other ones work)
>
> Did you try http://ceodbc.sourcefor
ge.net  ?
>
> I missed it the first time I went searching for odbc
modules.
>
> When I tried it, I got an error that according to the
driver docs was only
> applicable to the jdbc driver, which I wasn't using.
>
> Turns out the odbc driver had a bug in it, and Anthony
(ceODBC author) responded
> with a workaround (rename my exe to msdev.exe!) within
a day, and within a week
> had a ceODBC update that had a more elegant workaround.
 (he can't fix bugs in
> someone elses odbc driver, so workaround is as good as
it will get)
>

Quick test to see if it can do a simple thing.
>>> c=ceODBC.Connection('DSN=PMS',)
>>> d=c.cursor()
>>> d.execute('select * from PMSr')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ceODBC.NotSupportedError: Variable_TypeBySqlDataType:
unhandled data type 92
>>>

I guess datetime field or ulong is not supported. So I guess
I will
stick to what I have.
Thanks for the info do.
_______________________________________________
DB-SIG maillist  -  DB-SIGpython.org
http:/
/mail.python.org/mailman/listinfo/db-sig

Re: no-error error
country flaguser name
Germany
2007-10-19 16:18:58
Lukasz Szybalski wrote:
> Hello,
> I have a python program that converts some data and
writes it via ODBC driver.
> I am using a win32 dbi,odbc to do that. (none of the
free other ones work)
> 
> I just upgraded my ODBC driver to a newer version that
supposedly is a
> 2.0 compatible.
> 
> Now I am getting a:
> dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC
Driver]String or
> binary data would be truncated in EXEC
> 
> What I noticed is that dbi.no-error has given me this
error. How do I
> except a 'no-error' error?

I can't help you with that, but I'd suggest that you try our
mxODBC
Python ODBC interface.

It comes with support for errorhandlers, so you can work
around many
problems you find with an ODBC driver, such as error reports
which
really should be handled as warnings or not at all.

	http://
www.egenix.com/products/python/mxODBC/

BTW: Which ODBC driver are you using and against which
database
backend ?

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1,
Oct 19 2007)
>>> Python/Zope Consulting and Support ...       
http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
____________________________________________________________
____________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for
free ! ::::


   eGenix.com Software, Skills and Services GmbH 
Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre
Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
DB-SIG maillist  -  DB-SIGpython.org
http:/
/mail.python.org/mailman/listinfo/db-sig

Re: no-error error
user name
2007-10-24 14:36:05
On 10/19/07, Lukasz Szybalski <szybalskigmail.com> wrote:
> Hello,
> I have a python program that converts some data and
writes it via ODBC driver.
> I am using a win32 dbi,odbc to do that. (none of the
free other ones work)
>
> I just upgraded my ODBC driver to a newer version that
supposedly is a
> 2.0 compatible.
>
> Now I am getting a:
> dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC
Driver]String or
> binary data would be truncated in EXEC
>
This error means that truncation would have to happen, so
instead of
truncating the data the odbc driver decided to throw an
error and exit
the program.

Are truncation errors suppose to stop the write of data per
API 2.0
specifications?

I have tried the ceODBC and the new version that will come
out will
support the TopSpeed ODBC Driver 5.0 for tps data files.

Also, as a side not. If you ever come around a "Driver
not capable"
error you need to set the autocommit=True.

c = ceODBC.Connection("DSN=MYDATASOURCE",
autocommit = True)


> What I noticed is that dbi.no-error has given me this
error. How do I
> except a 'no-error' error?
And if you need to except any errors from database:

except ceODBC.DatabaseError, e:
    print e
   #do stuff

Thanks,
Lucas


-- 
-- 
Vim auto completion for python
http://lucasmanual.com/mywi
ki/FrontPage#head-8ce19b13e89893059e126b719bebe4ee32fe103c
TurboGears from start to finish:
http://w
ww.lucasmanual.com/mywiki/TurboGears
_______________________________________________
DB-SIG maillist  -  DB-SIGpython.org
http:/
/mail.python.org/mailman/listinfo/db-sig

Re: Re: no-error error
country flaguser name
Germany
2007-10-25 05:58:15
On 2007-10-24 21:36, Lukasz Szybalski wrote:
> On 10/19/07, Lukasz Szybalski <szybalskigmail.com> wrote:
>> Hello,
>> I have a python program that converts some data and
writes it via ODBC driver.
>> I am using a win32 dbi,odbc to do that. (none of
the free other ones work)
>>
>> I just upgraded my ODBC driver to a newer version
that supposedly is a
>> 2.0 compatible.
>>
>> Now I am getting a:
>> dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC
Driver]String or
>> binary data would be truncated in EXEC
>>
> This error means that truncation would have to happen,
so instead of
> truncating the data the odbc driver decided to throw an
error and exit
> the program.
> 
> Are truncation errors suppose to stop the write of data
per API 2.0
> specifications?

Well, yes. You hardly want data to be truncated while
transferring
it from or to the database.

> I have tried the ceODBC and the new version that will
come out will
> support the TopSpeed ODBC Driver 5.0 for tps data
files.
> 
> Also, as a side not. If you ever come around a
"Driver not capable"
> error you need to set the autocommit=True.
> 
> c = ceODBC.Connection("DSN=MYDATASOURCE",
autocommit = True)

While most file-based ODBC drivers require (re)enabling
auto-commit, you should be aware that by doing so, you risk
data corruption if you write to the data source and find an
error in the processing halfway through.

Transaction based programming saves you from this.

>> What I noticed is that dbi.no-error has given me
this error. How do I
>> except a 'no-error' error?
> And if you need to except any errors from database:
> 
> except ceODBC.DatabaseError, e:
>     print e
>    #do stuff

Right. DatabaseError is the base class of all database
interface
related errors as per the DB-API 2.0. This is true for all
DB-API 2.0 compatible database modules.

BTW: I wonder why SoftVelocity describes an ODBC driver
that
"conforms to the ODBC 1 specification with many Level 2
features"
as "new":

http://www.softvelocity.com/products/database_tsodbc.htm


The ODBC standard has already reached version 3.51 many
years ago.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1,
Oct 25 2007)
>>> Python/Zope Consulting and Support ...       
http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
____________________________________________________________
____________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for
free ! ::::


   eGenix.com Software, Skills and Services GmbH 
Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre
Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
DB-SIG maillist  -  DB-SIGpython.org
http:/
/mail.python.org/mailman/listinfo/db-sig

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )