Home > front end >  Flask inserted into the database problem SET IDENTITY_INSERT video ON
Flask inserted into the database problem SET IDENTITY_INSERT video ON

Time:10-11

Flask inserted into the database problems

FLASK_APP=app. Py
FLASK_ENV=development
FLASK_DEBUG=0
Folder In D:/my programming/flask
D: \ Virtualenv \ venv \ Scripts \ python exe -m flask run
* Serving Flask app "app. Py
"* the Environment: development
* the Debug mode: off
* Running on http://127.0.0.1:5000/(Press CTRL + C to quit)
[17:29:36 2019-12-09, 658] the ERROR in the app: Exception on/MovieUpload [POST]
Traceback (the most recent call last) :
File "SRC \ pymssql pyx", line 448, in pymssql. Cursor. The execute
File "SRC \ _mssql pyx", line 1064, in _mssql. MSSQLConnection. Execute_query
File "SRC \ _mssql pyx", line 1095, in _mssql. MSSQLConnection. Execute_query
File "SRC \ _mssql pyx", line 1228, in _mssql. MSSQLConnection. Format_and_run_query
The File "SRC \ _mssql pyx", line 1639, in _mssql. Check_cancel_and_raise
The File "SRC \ _mssql pyx", line 1683, in _mssql. Maybe_raise_MSSQLDatabaseException
_mssql. MSSQLDatabaseException: (8106 b, "Table 'video' does not have the identity property. Always perform a SET operation. The DB - Lib error message 20018, severity 16: \ nGeneral SQL Server error: Check the messages from the SQL Server \ n")

During handling of the above exception, another exception occurred:

Traceback (the most recent call last) :
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ engine \ base py", line 1318, in _cursor_execute
The self. The dialect. Do_execute (cursor, the statement, the parameters, the context)
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ engine \ default py", line 581, in do_execute
Cursor. The execute (statement, the parameters)
File "SRC \ pymssql pyx", line 468, in pymssql. Cursor. The execute
Pymssql. OperationalError: (8106 b, "Table 'video' does not have the identity property. Always perform a SET operation. The DB - Lib error message 20018, severity 16: \ nGeneral SQL Server error: Check the messages from the SQL Server \ n")

The above exception was The direct cause of The following exception:

Traceback (the most recent call last) :
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Lib \ site - packages \ flask \ app. Py", line 2446, in wsgi_app
The response=self. Full_dispatch_request ()
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Lib \ site - packages \ flask \ app. Py", line 1951, in full_dispatch_request
The rv=self. Handle_user_exception (e)
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Lib \ site - packages \ flask \ app. Py", line 1820, in handle_user_exception
Reraise (exc_type exc_value, TB)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Lib \ site - packages \ flask \ _compat py", line 39, reraise in
Raise the value
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Lib \ site - packages \ flask \ app. Py", line 1949, in full_dispatch_request
The rv=self. Dispatch_request ()
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Lib \ site - packages \ flask \ app. Py", line 1935, in dispatch_request
Return the self. View_functions [rule. The endpoint] (* * the req. View_args)
The File "D: \ my programming \ flask \ app py", line 213, in MovieUpload
Mod. Tablevideo. InsertTablevideo (videoid, select the name, 'static/' + thepath1, grade,' static/' + thepath2, about, cast, dirctor)
The File "D: \ my programming \ flask \ mod py", line, 59 in InsertTablevideo
The session. The add (video)
File "c: \ users \ \ administrator \ \ appdata \ local \ designed \ python python37 \ Lib \ contextlib py", line 119, in __exit__
Next (self. Gen)
The File "D: \ my programming \ flask \ mod py", line 123, in session_scope
MIT ()
session.comThe File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ session py", line 1027, in the commit
MIT ()
self.transaction.comThe File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ session py", line 494, in the commit
Self. _prepare_impl ()
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ session py", line 473, in _prepare_impl
The self. The session. Flush ()
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ session py", line 2470, flush in
Self. _flush (objects)
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ session py", line 2608, in _flush
Transaction. The rollback (_capture_exception=True)
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ util \ langhelpers py", line 68, in __exit__
Compat. Reraise (exc_type exc_value, exc_tb)
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ util \ compat py", line 153, reraise in
Raise the value
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ session py", line 2568, in _flush
Flush_context. The execute ()
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ unitofwork py", line 422, in the execute
Rec. Execute (self)
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ unitofwork py", line 589, in the execute
Uow,
The File "D: \ Virtualenv \ venv \ lib \ site - packages \ sqlalchemy \ orm \ persistence py", line 245, in save_obj
Insert,
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related