You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pseudo:
CREATE TABLE tableX ..
CREATE VIEW tableX_view
CREATE TRIGGER tableX_view_trigger ON tableX_view INSTEAD OF INSERT AS ..
IF a=b
BEGIN
INSERT INTO tableY FROM inserted ..
END
File "C:\python\Python37-32\lib\site-packages\pydal\adapters\mssql.py", line 98, in lastrowid
return long(self.cursor.fetchone()[0])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
pseudo:
CREATE TABLE tableX ..
CREATE VIEW tableX_view
CREATE TRIGGER tableX_view_trigger ON tableX_view INSTEAD OF INSERT AS ..
IF a=b
BEGIN
INSERT INTO tableY FROM inserted ..
END
File "C:\python\Python37-32\lib\site-packages\pydal\adapters\mssql.py", line 98, in lastrowid
return long(self.cursor.fetchone()[0])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
"""
def lastrowid(self, table):
self.execute("SELECT SCOPE_IDENTITY();")
return long(self.cursor.fetchone()[0])
"""
suggestions:
1/ self.execute("SELECT @@IDENTITY();") MSSQL Docs
2/
try: return long(self.cursor.fetchone()[0])
except (TypeError): return None
The text was updated successfully, but these errors were encountered: