Answer the question
In order to leave comments, you need to log in
Where is the error in insert query in Postgres?
Here is my code:
output_file_name_read = open(output_file_name,'rb').read() # там мы писали, тут читаем
# SQL_update_request = """UPDATE "REQUESTS" SET shape = {0} WHERE request_id = 6""".format(psycopg2.Binary(output_file_name_read))
currDst.execute("""UPDATE "REQUESTS" SET shape = %s WHERE request_id = 7""", psycopg2.Binary(output_file_name_read))
postconn.commit()
Traceback (most recent call last):
File "C:\work\App.py", line 67, in <module>
main()
File "C:\work\App.py", line 64, in main
SyncRequest(postconn, fireconn, 'POSTID', 'FIREID')
File "C:\work\App.py", line 49, in SyncRequest
currDst.execute("""UPDATE "REQUESTS" SET shape = %s WHERE request_id = 7""", psycopg2.Binary(output_file_name_read))
File "C:\Python27\ArcGIS10.1\lib\site-packages\fdb\fbcore.py", line 3322, in execute
PreparedStatement(operation, self, True))
File "C:\Python27\ArcGIS10.1\lib\site-packages\fdb\fbcore.py", line 1934, in __init__
"Error while preparing SQL statement:")
fdb.fbcore.DatabaseError: ('Error while preparing SQL statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = -104\n- Token unknown - line 1, column 31\n- %', -104, 335544569)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question