Changeset 252:cf5111fc2d2a in livinglogic.python.orasql

Show
Ignore:
Timestamp:
04/01/08 16:18:09 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Tags:
rel-1-23-2
Message:

When calling procedures, arguments are now wrapped in variables for their real type.

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r250 r252  
     1Changes in 1.23.2 (released 04/01/2008) 
     2--------------------------------------- 
     3 
     4*   When calling functions/procedures, arguments are now wrapped in variable 
     5    objects for their real type instead of ones for the type the function or 
     6    procedure expects. 
     7 
     8 
    19Changes in 1.23.1 (released 03/25/2008) 
    2 ------------------------------------- 
     10--------------------------------------- 
    311 
    412*   Added a :meth:`__contains__` to :class:`Record` for checking the existence 
  • setup.py

    r250 r252  
    5656args=dict( 
    5757    name="ll-orasql", 
    58     version="1.23.1", 
     58    version="1.23.2", 
    5959    description="Utilities for working with cx_Oracle", 
    6060    long_description=descr, 
  • src/ll/orasql/__init__.py

    r250 r252  
    18681868    } 
    18691869     
     1870    _py2cx = { 
     1871        datetime.datetime: DATETIME, 
     1872        int: NUMBER, 
     1873        long: NUMBER, 
     1874        float: NUMBER, 
     1875        str: STRING, 
     1876    } 
     1877     
    18701878    def __init__(self, name, owner=None, connection=None): 
    18711879        Object.__init__(self, name, owner, connection) 
     
    19231931        arg = cursor._encode(arg) 
    19241932        try: 
    1925             type = self._ora2cx[arginfo.datatype] 
     1933            if arg is None: 
     1934                t = self._ora2cx[arginfo.datatype] 
     1935            else: 
     1936                t = self._py2cx[type(arg)] 
    19261937        except KeyError: 
    19271938            raise TypeError("can't handle parameter %s of type %s in %r" % (arginfo.name, arginfo.datatype, self)) 
    1928         if type is STRING and isinstance(arg, str) and len(arg) >= 4000: 
    1929             type = CLOB 
    1930         var = cursor.var(type) 
     1939        if t is STRING and isinstance(arg, str) and len(arg) >= 4000: 
     1940            t = CLOB 
     1941        var = cursor.var(t) 
    19311942        var.setvalue(0, arg) 
    19321943        return var