Comments (17)
[deleted comment]
from pypyodbc.
[deleted comment]
from pypyodbc.
[deleted comment]
from pypyodbc.
Please run the attached pypyodbc, it will print out the buffer of the encoded
unicode strings, so we can see how to decode the strings.
Please post the outputs and the exceptions.
Original comment by [email protected]
on 25 Aug 2013 at 2:54
Attachments:
from pypyodbc.
Hello I got the same issue trying to connect to a Oracle Database.
1.1.3 on Python 2.7, CentOS 6.4 64bits
Below the error:
In [2]: conect =
pypyodbc.connect('''Driver=FreeTDS;Server=10.1.1.1;port=1433;uid=user;pwd=pass;d
atabase=test''')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-bc4f1e15f4f6> in <module>()
----> 1 conect =
pypyodbc.connect('''Driver=FreeTDS;Server=10.1.1.1;port=1433;uid=user;pwd=pass;d
atabase=test''')
/tmp/pypyodbc.py in __init__(self, connectString, autocommit, ansi, timeout,
unicode_results, readonly, **kargs)
2287 check_success(self, ret)
2288
-> 2289 self.connect(connectString, autocommit, ansi, timeout,
unicode_results, readonly)
2290
2291
/tmp/pypyodbc.py in connect(self, connectString, autocommit, ansi, timeout,
unicode_results, readonly)
2335 else:
2336 ret = odbc_func(self.dbc_h, 0, c_connectString, len(self.connectString), None, 0, None, SQL_DRIVER_NOPROMPT)
-> 2337 check_success(self, ret)
2338
2339
/tmp/pypyodbc.py in check_success(ODBC_obj, ret)
953 ctrl_err(SQL_HANDLE_STMT, ODBC_obj.stmt_h, ret, ODBC_obj.ansi)
954 elif isinstance(ODBC_obj, Connection):
--> 955 ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)
956 else:
957 ctrl_err(SQL_HANDLE_ENV, ODBC_obj, ret, False)
/tmp/pypyodbc.py in ctrl_err(ht, h, val_ret, ansi)
911 ret = ODBC_func(ht, h, number_errors, state, \
912 ADDR(NativeError), Message, 1024, ADDR(Buffer_len))
--> 913 debug = state.raw
914 print (debug)
915 if ret == SQL_NO_DATA_FOUND:
AttributeError: 'c_wchar_Array_36' object has no attribute 'raw'
Original comment by [email protected]
on 2 Sep 2013 at 5:56
from pypyodbc.
Issue 11 has been merged into this issue.
Original comment by [email protected]
on 3 Sep 2013 at 11:35
from pypyodbc.
I get exactly the same output as [email protected]
Original comment by [email protected]
on 3 Sep 2013 at 1:45
from pypyodbc.
Using 1.1.6dev
In [2]: pypyodbc.version
Out[2]: '1.1.6dev'
In [3]: conect =
pypyodbc.connect('''Driver=FreeTDS;Server=10.1.1.1;port=1433;uid=user;pwd=pass;d
atabase=test''')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-bc4f1e15f4f6> in <module>()
----> 1 conect =
pypyodbc.connect('''Driver=FreeTDS;Server=10.1.1.1;port=1433;uid=user;pwd=pass;d
atabase=test''')
/tmp/pypyodbc.pyc in __init__(self, connectString, autocommit, ansi, timeout,
unicode_results, readonly, **kargs)
2287 check_success(self, ret)
2288
-> 2289 self.connect(connectString, autocommit, ansi, timeout,
unicode_results, readonly)
2290
2291
/tmp/pypyodbc.pyc in connect(self, connectString, autocommit, ansi, timeout,
unicode_results, readonly)
2335 else:
2336 ret = odbc_func(self.dbc_h, 0, c_connectString, len(self.connectString), None, 0, None, SQL_DRIVER_NOPROMPT)
-> 2337 check_success(self, ret)
2338
2339
/tmp/pypyodbc.pyc in check_success(ODBC_obj, ret)
953 ctrl_err(SQL_HANDLE_STMT, ODBC_obj.stmt_h, ret, ODBC_obj.ansi)
954 elif isinstance(ODBC_obj, Connection):
--> 955 ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)
956 else:
957 ctrl_err(SQL_HANDLE_ENV, ODBC_obj, ret, False)
/tmp/pypyodbc.pyc in ctrl_err(ht, h, val_ret, ansi)
911 ret = ODBC_func(ht, h, number_errors, state, \
912 ADDR(NativeError), Message, 1024, ADDR(Buffer_len))
--> 913 debug = state.raw
914 print (debug)
915 if ret == SQL_NO_DATA_FOUND:
AttributeError: 'c_wchar_Array_36' object has no attribute 'raw'
Original comment by [email protected]
on 3 Sep 2013 at 8:33
from pypyodbc.
Dear all, please have a try with the attached pypyodbc.py
Original comment by [email protected]
on 6 Sep 2013 at 3:57
Attachments:
from pypyodbc.
Hello,
Don't return a error now but seems to be a infinite loop.
In [5]: conect =
pypyodbc.connect('''Driver=FreeTDS;Server=10.0.0.1;port=1433;uid=user;pwd=pass;d
atabase=MYDB''')
08S01
Original comment by [email protected]
on 6 Sep 2013 at 1:06
from pypyodbc.
Hi, the infinite loop should be fixed by this update. Please have a try.
Original comment by [email protected]
on 6 Sep 2013 at 1:15
Attachments:
from pypyodbc.
This revision works for me! Thanks. Will it be merged with the trunk?
Original comment by [email protected]
on 6 Sep 2013 at 1:19
from pypyodbc.
Yes, I will merge it after some more test and see other people's feed back.
You were testing the last version, right?
Original comment by [email protected]
on 6 Sep 2013 at 1:25
from pypyodbc.
I was using the version in comment 11
Original comment by [email protected]
on 6 Sep 2013 at 1:28
from pypyodbc.
Hello,
With last version is working, thanks!
Original comment by [email protected]
on 6 Sep 2013 at 1:36
from pypyodbc.
But I row name attributes aren't set.
For example:
cursor.execute("SELECT * FROM myTable WHERE 1;")
rows = cursor.fetchall()
for row in rows:
print row.id
AttributeError: 'Row' object has no attribute 'id'
Instead, I have to do
for row in rows:
print row[0]
1
2
3
4
5
..etc..
Original comment by [email protected]
on 9 Sep 2013 at 8:29
from pypyodbc.
This is not supported by pypyodbc, reason is explained here:
https://code.google.com/p/pypyodbc/issues/detail?id=10
In stead, pypyodbc offers row['id']
And, version 1.2.0 has been uploaded which contains the fix of this thread.
Original comment by [email protected]
on 21 Sep 2013 at 11:16
- Changed state: Fixed
from pypyodbc.
Related Issues (20)
- Description attribute returns only first char of name (as byte) using Oracle ODBC & Linux HOT 2
- Trimmed varchar results.
- Column names get wonky on 64-bit system using iSeries DB2 driver HOT 3
- Oracle and Decimal_cvt issue
- IronPython 2.7 StopIteration exception raised when retrieving SQL data set
- "invalid literal" exceptions querying empty numeric fields when using LinuxODBC with FreeTDS
- use mbdtools,chinese character encoded by gb charset can't access correctly
- Passing datetime.date returns TypeError: Wrong Type HOT 2
- Mapping bigint in sqlserver 2008 into float, instead of int in python3
- Bad cursor description (mixed bytes and strings) on Ubuntu 14.04 HOT 2
- Row objects don't raise KeyError for invalid fields
- Data source name not found on linux + unixodbc + as400 iseries driver HOT 1
- Cannot access column names by attribute HOT 4
- pypyodbc doesn't support the MSSQL datetimeoffset column type.
- state = err_list[0][0] Index out of range
- UnicodeDecodeError because UTF-16 surrogate pairs are not handled HOT 1
- Enhancement: Support for lists as SQL parameters
- executemany is very slow
- Sage Line 100 Odbc connect KO HOT 1
- Not working on Windows 7 64 bit 3.4.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypyodbc.