Oracle学习笔记--- ORA-00911: invalid character 解决办法

在跑一段程序的时候,测试执行sql语句,报错 ORA-00911: invalid character


源码:

print "generate the primary_key , seral_key sql ==========================>"
        primary_key_sql = "select CONSTRAINT_NAME from user_constraints where table_name = '%s' and constraint_type = 'P';"%(table)
        serial_key_sql = "select sequence_name from user_sequences;"
        maxval_sql = "select max_value from user_sequences"
        print "gain the serial_key ==============================>"
        serial_key = self.execute_meod(serial_key_sql)


上述sql语句执行时报错,解决方案如下:

将每个sql语句的最后 “ ; ” 去掉。

Oracle学习笔记--- ORA-00911: invalid character 解决办法_第1张图片

你可能感兴趣的:(Python,数据库)