Problem

随机显示问题

Problèmes d’affichage aléatoires

软件 >> PostgreSQL
Questions in category: PostgreSQL (PostgreSQL).

奇怪的问题

Posted by haifeng on 2014-09-03 22:06:22 last update 2014-09-03 22:19:24 | Answers (0)


INSERT INTO categories ("name", "parent", "name_en", "stocks_num", "price_in", "price_out", "factory") VALUES ('计算器', 0, 'jsq', , , , '');

使用 pg_last_error() 函数返回:
ERROR: syntax error at or near "," LINE 1: ...rice_out", "factory") VALUES ('计算器', 0, 'jsq', , , , ''); ^

如果使用 pg_admin3, 执行上面的 sql 语句得到

ERROR:  syntax error at or near "insert"
LINE 1: insert INTO categories ("name", "parent", "name_en", "sto...
        ^

 

问题可能出在上面有好几个变量为空, 如果这几个变量均有值的话,则可以顺利插入到数据库中.