# HG changeset patch # User catherine@Drou # Date 1265741304 18000 # Node ID b34ea206c7d1b41b61668800012e27bcad40c4f0 # Parent e89db2eaa0b4c95dbbe640715dd5c0e3d0d0ef6e debug bind var dependence on arg.parsed.expanded diff -r e89db2eaa0b4 -r b34ea206c7d1 docs/source/capabilities.rst --- a/docs/source/capabilities.rst Tue Feb 09 08:24:30 2010 -0500 +++ b/docs/source/capabilities.rst Tue Feb 09 13:48:24 2010 -0500 @@ -37,6 +37,9 @@ History ======= +If used on a *nix machine with ``readline`` installed, then ``bash``-like access +to the command history is available. + The up- and down-arrow keys allow you to scroll through the lines entered so far in your sqlpython session. @@ -249,6 +252,17 @@ When the `autobind` sqlpython parameter is True, a `bind` statement is issued automatically after every query that returns exactly one row. +Once bind variables are defined, they can be used in SQL statements. The syntax +is dependnent on which RDBMS is being queried. + +---------- ------------------------------------------ +RDBMS bind variable example +---------- ------------------------------------------ +Oracle SELECT * FROM party WHERE name = :name; +postgreSQL SELECT * FROM party WHERE name = %(name)s; +MySQL SELECT * FROM party WHERE name = ; +---------- ------------------------------------------ + Bind variables are available from within Python as a dictionary named `binds` (see Python). Substitution variables diff -r e89db2eaa0b4 -r b34ea206c7d1 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Tue Feb 09 08:24:30 2010 -0500 +++ b/sqlpython/sqlpyPlus.py Tue Feb 09 13:48:24 2010 -0500 @@ -1353,6 +1353,7 @@ (False, 'foo', None) ''' arg = self.parsed(arg) + import pdb; pdb.set_trace() try: var, val = self.assignmentSplitter.split(arg.parsed.expanded, maxsplit=1) except ValueError: diff -r e89db2eaa0b4 -r b34ea206c7d1 sqlpython/sqlpython.py --- a/sqlpython/sqlpython.py Tue Feb 09 08:24:30 2010 -0500 +++ b/sqlpython/sqlpython.py Tue Feb 09 13:48:24 2010 -0500 @@ -9,7 +9,7 @@ # See also http://twiki.cern.ch/twiki/bin/view/PSSGroup/SqlPython import cmd2,getpass,binascii,re,os,platform -import pyparsing, schemagroup, connections +import pyparsing, connections __version__ = '1.7.0' try: import cx_Oracle