[英]Syntax error when inserting into foreign key
I keep getting errors trying to insert data into my table. 尝试将数据插入表中时,我不断收到错误消息。 I have tried:
我努力了:
insert into saferdb_dot_contacts (fax, email, "dot_num_id")
values( 'nan', 'nan', 4);
ERROR: column "dot_num_id" of relation "saferdb_dot_contacts" >does not exist
错误:关系“ saferdb_dot_contacts”的列“ dot_num_id”>不存在
I tried: 我试过了:
insert into saferdb_dot_contacts (fax, email, dot_num_id)
values( 'nan', 'nan', 4);
ERROR: column "dot_num_id" of relation "saferdb_dot_contacts" >does not exist
错误:关系“ saferdb_dot_contacts”的列“ dot_num_id”>不存在
I tried to access the field via 我试图通过访问该字段
SELECT dot_num_id FROM saferdb_dot_contacts;
but got : 但是得到了:
ERROR: column "dot_num_id" does not exist LINE 1: SELECT dot_num_id FROM >saferdb_dot_contacts;
错误:列“ dot_num_id”不存在第1行:SELECT dot_num_id FROM> saferdb_dot_contacts;
I tried: 我试过了:
SELECT 'dot_num_id' FROM saferdb_dot_contacts;
Which gave me a strange output of a column labled ?column? 哪个给了我奇怪的列标记“列”输出?
if it helps dot_num_id is has a foreign key relationship to another table. 如果有帮助,则dot_num_id与另一个表具有外键关系。
EDIT: I also tried: 编辑:我也尝试过:
SELECT "dot_num_id" FROM saferdb_dot_contacts;
ERROR: column "dot_num_id" does not exist LINE 2: SELECT "dot_num_id" FROM saferdb_dot_contacts;
错误:“ dot_num_id”列不存在第2行:从saferdb_dot_contacts中选择“ dot_num_id”; ^ SQL state: 42703
^ SQL状态:42703
You need to watch out for case sensivity and use double quotes. 您需要注意区分大小写并使用双引号。 Try:
尝试:
insert into saferdb_dot_contacts (fax, email, "DOT_Num_id")
values( 'nan', 'nan', 4);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.