I have a table in sqlserver 2008r2 where the ID column is not an identity 
(but is a unique integer). The ID column is not called ID.
I am using update_or_insert and in the case of new record I provide the 
value for the ID column.
This is web2py trunk. The database adapter is mssql3 

I am getting an exception in this code in mssql.py (line 155-ish)

    def lastrowid(self,table):
        #self.execute('SELECT @@IDENTITY;')
        self.execute('SELECT SCOPE_IDENTITY();')
        return long(self.cursor.fetchone()[0])

The exception is 

<type 'exceptions.TypeError'> long() argument must be a string or a number, 
not 'NoneType'
It is occurring when an insert is happening. The insert is correctly 
provided a unique ID for the non-identity primary key. 
This function is not run very often but this bug with not present earlier.
I guess I can bisect it but first I'd like to know if the ID column must be 
an identity. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to