skoczian | 5 Sep 2011 17:58
Picon

pyfirebirdsql: error with very simple parameterized query

Hello,

I can't understand this:

>>> conn = firebirdsql.connect(dsn="localhost:Versand", user="sib", password="immergut", charset="UTF8")
>>> sql3 = 'SELECT katnr FROM prodkat WHERE katname = ?'
>>> curs = conn.cursor()
>>> curs.execute(sql3, ("Wolle",))
Traceback (most recent call last):
  File "<pyshell#31>", line 1, in <module>
    curs.execute(sql3, ("Wolle",))
  File "C:\Python32\lib\site-packages\firebirdsql\fbcore.py", line 443, in execute
    (h, oid, buf) = self.connection._op_response()
  File "C:\Python32\lib\site-packages\firebirdsql\fbcore.py", line 1055, in _op_response
    raise OperationalError(message, gds_codes, sql_code)
firebirdsql.OperationalError: Dynamic SQL Error
SQL error code = -303
internal error

This query, using a parameter for a numeric database column, works as expected:

>>> sql4 = "SELECT katname FROM prodkat WHERE katnr = ?"
>>> curs.execute(sql4, (7,))
>>> for x in curs.fetchall():
	print(x)
	
['Wolle']

And this works too:

(Continue reading)

skoczian | 5 Sep 2011 18:02
Picon

Re: pyfirebirdsql: error with very simple parameterized query

Sorry, forgot version information:

pyfirebirdsql 0.4.4, Firebird 2.5.0 on Windows 7 64bit.

Sibylle

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-python-digest@... 
    firebird-python-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    firebird-python-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

(Continue reading)

Philippe Makowski | 6 Sep 2011 10:14

Re: Re: pyfirebirdsql: error with very simple parameterized query

Strange

is tests.py running well ?

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-python-digest@... 
    firebird-python-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    firebird-python-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

skoczian | 6 Sep 2011 16:16
Picon

Re: pyfirebirdsql: error with very simple parameterized query

--- In firebird-python@..., Philippe Makowski
<makowski <at> ...> wrote:
>
> Strange
> 
> is tests.py running well ?
>
Yes, it is. And I see the parameterized update query in that script.

Will try a little more and report.

Greetings,
Sibylle

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-python-digest@... 
(Continue reading)

skoczian | 6 Sep 2011 17:42
Picon

Re: pyfirebirdsql: error with very simple parameterized query

--- In firebird-python@..., "skoczian"
<nulla.epistola <at> ...> wrote:
>
> 
> Will try a little more and report.
> 
Tried some queries using the database test.py created. Result:

No errors with parameterized update queries. No errors with select queries with a numeric parameter. The
same error message I cited in my first post with select queries containing a string parameter.

Really very strange.
Sibylle

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-python-digest@... 
(Continue reading)

Philippe Makowski | 7 Sep 2011 18:47

Re: Re: pyfirebirdsql: error with very simple parameterized query

skoczian  [2011-09-06 17:42] :
> --- In firebird-python@..., "skoczian"
<nulla.epistola <at> ...> wrote:
> Really very strange.
Windows ?
is your script encoded in UTF8 ?

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-python-digest@... 
    firebird-python-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    firebird-python-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
(Continue reading)

skoczian | 8 Sep 2011 22:24
Picon

Re: pyfirebirdsql: error with very simple parameterized query


--- In firebird-python@..., Philippe Makowski
<makowski <at> ...> wrote:
>
> skoczian  [2011-09-06 17:42] :
> > --- In firebird-python@..., "skoczian" <nulla.epistola <at> > wrote:
> > Really very strange.
> Windows ?

Yes (Windows 7).

> is your script encoded in UTF8 ?
>
No script, I'm trying this in the interactive shell. Will change to a script, but not today or tomorrow (no
time). 

Python 3.2.2, by the way.

Greetings,
Sibylle

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional
(Continue reading)

Hajime Nakagami | 9 Sep 2011 19:03
Picon

Re: pyfirebirdsql: error with very simple parameterized query

Hi everyone

Please try new release 0.5.0
http://pypi.python.org/pypi/firebirdsql/0.5.0

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-python-digest@... 
    firebird-python-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    firebird-python-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

(Continue reading)

Philippe Makowski | 10 Sep 2011 11:30

Pyfirebirdsql : things to do

Hi,

here a first todo list :

- add multiple transactions per connection management
 (cf
http://web.firebirdsql.org/devel/python/docs/3.3.0/beyond-python-db-api.html#using-multiple-transactions-with-the-same-connection)

- add prepared statements management
 (cf
http://web.firebirdsql.org/devel/python/docs/3.3.0/beyond-python-db-api.html#prepared-statements)
- extend services api
 (cf
http://web.firebirdsql.org/devel/python/docs/3.3.0/beyond-python-db-api.html#module-kinterbasdb.services)
- improve info_database output (see db_info in kinterbasdb
(http://firebird.svn.sourceforge.net/viewvc/firebird/kinterbasdb/trunk/__init__.py?revision=53433&view=markup))

after that, I think that someone could work on sqlalchemy integration

I'll try to first add the multiple transactions per connection
management in my repo (will create a branche for that)

Volunteers ?
Any thing else ?

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
(Continue reading)

skoczian | 10 Sep 2011 13:37
Picon

Re: pyfirebirdsql: error with very simple parameterized query

--- In firebird-python@..., Hajime Nakagami <nakagami <at> ...> wrote:
>
> Hi everyone
> 
> Please try new release 0.5.0
> http://pypi.python.org/pypi/firebirdsql/0.5.0
>
Done. I hadn't tried this with the former version, but: if I use byte sequences instead of strings as
parameters, the queries run as expected.

The character set I'm using doesn't seem to make a difference.

Thank you,
Sibylle

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-python/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-python/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)


Gmane