[egenix-users] problems with MSSQL Server functions

M.-A. Lemburg mal at egenix.com
Fri Jan 21 14:49:47 CET 2005


Moof wrote:
> Hi,
> 
> I seem to have a slight problem with MSSQL server.
> 
> c is a cursor to an SQL Server instance:
> 
> c.execute('SELECT * FROM GetBestRates_Moof( ?, ?, ?, ?, ?, ? ) tab',
>            (fromDate, toDate, self.idCorp, idRoom, idRegimen, self.idHotel))

This doesn't look like valid SQL to me. Could you explain what the
function does and what "tab" is for ?

> gives me the following error:
> 
> 
> Traceback (most recent call last):
>   File "<input>", line 1, in ?
>   File "C:\...\hoteltypes.py", line 153, in getBestRates
>     rates = self._getBestRates(fromDate, toDate, idRegimen, idRoom)
>   File "C:\...\DB.py", line 93, in _getBestRates
>     (fromDate, toDate, self.idCorp, idRoom, idRegimen, self.idHotel))
> InternalError: ('S1093', 0, '[Microsoft][ODBC SQL Server Driver]Invalid
> parameter number', 4504)
> 
> for the record, at this point:
> 
> fromDate = 38373.0, toDate = 38377.0, idCorp = -1, idRoom = -1, idRegimen =
> 0, idHotel = 1
> 
> (fromDate and toDate were mx.DateTime instances, but I changed them to COM
> dates just in case that was the issue)
> 
> I'm a bit stumped as to why I'm getting this error. Any ideas?
> 
> Moof

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 20 2005)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the egenix-users mailing list