【发布时间】:2022-08-15 04:13:38
【问题描述】:
import cx_Oracle
dsn_tns = cx_Oracle.makedsn(\'**********\', \'*******\', service_name=\'***\')
conn = cx_Oracle.connect(user=\'******\', password=\'*******\', dsn=dsn_tns)
c = conn.cursor()
c.execute(\'select username,created from dba_users where username=\'USERNAME\' \')
for row in c:
print (row[0], \'-\', row[1]) # this only shows the first two columns. To add an additional column you\'ll need to add , \'-\', row[2], etc.
conn.close()
File \"*******************\", line 9
c.execute(\'select username,created from dba_users where username=\'MONITOR\' \')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
这里出了什么问题,当我在用户名周围使用单引号时,我收到了这个错误。