definitively needs to be an identity to make any insert*() work. And it is
since the beginning.
On Monday, October 27, 2014 8:42:12 AM UTC+1, Tim Richardson wrote:
>
>
>
> On Monday, 27 October 2014 18:17:10 UTC+11, Tim Richardson wrote:
>>
>> 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 was not present
>> "earlier" (not known how much earlier).
>> I can bisect it but first I'd like to know if the ID column must be an
>> identity.
>>
>>
> The more I think about this, the more I wonder it was not an error
> earlier.
> The documentation is very clear, in any case. It should 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 [email protected].
For more options, visit https://groups.google.com/d/optout.