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
cursor=conn.cursor()
placeholder=','.join(['%s']*len(data.dtype.names))
for row in data:
for i,value in enumerate(row):
if isinstance(value,np.datetime64):
row[i]=datetime64_to_datetime(value)
row = tuple(row)
cursor.execute(f"INSERT INTO {table}({','.join(data.dtype.names)}) VALUES({placeholder})",row)
我在网上看到%s占位符,然后execute时把实际数值放进去我实际操作的时候报错了
错误信息:
Traceback (most recent call last):
File "load_into_database.py", line 27, in
narray_to_taos('127.0.0.1','root','123456','test',6041,'mytest',data)
File "load_into_database.py", line 20, in narray_to_taos
cursor.execute(f"INSERT INTO {table}({','.join(data.dtype.names)}) VALUES({placeholder})",row)
taosws.OperationalError: [0x0216] Internal error: syntax error near '%s,%s,%s)' (invalid data or symbol)
The text was updated successfully, but these errors were encountered:
cursor=conn.cursor()
placeholder=','.join(['%s']*len(data.dtype.names))
for row in data:
for i,value in enumerate(row):
if isinstance(value,np.datetime64):
row[i]=datetime64_to_datetime(value)
我在网上看到%s占位符,然后execute时把实际数值放进去我实际操作的时候报错了
错误信息:
Traceback (most recent call last):
File "load_into_database.py", line 27, in
narray_to_taos('127.0.0.1','root','123456','test',6041,'mytest',data)
File "load_into_database.py", line 20, in narray_to_taos
cursor.execute(f"INSERT INTO {table}({','.join(data.dtype.names)}) VALUES({placeholder})",row)
taosws.OperationalError: [0x0216] Internal error:
syntax error near '%s,%s,%s)' (invalid data or symbol)
The text was updated successfully, but these errors were encountered: