Coder Social home page Coder Social logo

Comments (17)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Issue 11 has been merged into this issue.

Original comment by [email protected] on 3 Sep 2013 at 11:35

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I get exactly the same output as [email protected]

Original comment by [email protected] on 3 Sep 2013 at 1:45

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I was using the version in comment 11

Original comment by [email protected] on 6 Sep 2013 at 1:28

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hello,

With last version is working, thanks!

Original comment by [email protected] on 6 Sep 2013 at 1:36

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.