Mercurial > sqlpython
changeset 445:b34ea206c7d1
debug bind var dependence on arg.parsed.expanded
author | catherine@Drou |
---|---|
date | Tue, 09 Feb 2010 13:48:24 -0500 |
parents | e89db2eaa0b4 |
children | 1cf1f69b2470 |
files | docs/source/capabilities.rst sqlpython/sqlpyPlus.py sqlpython/sqlpython.py |
diffstat | 3 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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:
--- 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