‘narrative’在代码中的错误是什么?

huangapple go评论63阅读模式
英文:

what is the 'narrative'error here in the code?

问题

创建表 CONSUMER_COMPLAINTS

DATE_RECEIVED STRING,
PRODUCT_NAME VARCHAR2(50),
SUB_PRODUCT VARCHAR2(40),
ISSUE VARCHAR2(100),
SUB_ISSUE VARCHAR2(100),
CONSUMER COMPLAINT NARRATIVE VARCHAR2(100),
Company Public Response STRING,
Company VARCHAR(30),
State Name CHAR(4),
Zip_Code INTEGER,
Tags VARCHAR(10),
Consumer Consent Provided CHAR(6),
Submitted via STRING,
Date Sent_to_Company STRING,
Company Response_to_Consumer VARCHAR(2),
Timely Response CHAR(4),
CONSUMER DISPUTED CHAR(4),
COMPLAINT_ID NUMBER(12,0)NOT NULL PRIMARY KEY
);

英文:
CREATE TABLE  CONSUMER_COMPLAINTS 
   (	
      DATE_RECEIVED STRING,
      PRODUCT_NAME VARCHAR2(50), 
      SUB_PRODUCT VARCHAR2(40), 
      ISSUE VARCHAR2(100), 
      SUB_ISSUE VARCHAR2(100),
      CONSUMER COMPLAINT NARRATIVE VARCHAR2(100),
      Company Public Response STRING,
      Company VARCHAR(30),
      State Name CHAR(4),
      Zip_Code INTEGER,
      Tags VARCHAR(10),
      Consumer Consent Provided CHAR(6),
       Submitted via STRING,
      Date Sent_to_Company STRING,
     Company Response_to_Consumer VARCHAR(2),
     Timely Response CHAR(4),
     CONSUMER DISPUTED CHAR(4),
     COMPLAINT_ID NUMBER(12,0) NOT NULL PRIMARY KEY
);

i tried to create a table but it is showing this error:
SQL compilation error: syntax error line 8 at position 25 unexpected 'NARRATIVE'. syntax error line 8 at position 35 unexpected 'VARCHAR2'. syntax error line 8 at position 43 unexpected '('.

答案1

得分: 1

Column names should not have spaces. The error is indicating the word NARRATIVE in your 8th line of code CONSUMER COMPLAINT NARRATIVE VARCHAR2(100).

Please try below query:

创建表格 CONSUMER_COMPLAINTS
(
DATE_RECEIVED 字符串,
PRODUCT_NAME 字符串(50),
SUB_PRODUCT 字符串(40),
ISSUE 字符串(100),
SUB_ISSUE 字符串(100),
CONSUMER_COMPLAINT_NARRATIVE 字符串(100),
Company_Public_Response 字符串,
Company 字符串(30),
State_Name 字符(4),
Zip_Code 整数,
Tags 字符串(10),
Consumer_Consent_Provided 字符(6),
Submitted_via 字符串,
Date_Sent_to_Company 字符串,
Company_Response_to_Consumer 字符串(2),
Timely_Response 字符(4),
CONSUMER_DISPUTED 字符(4),
COMPLAINT_ID 数字(12,0) 非空 主键
);

英文:

Column names should not have spaces. The error is indicating the word NARRATIVE in your 8th line of code CONSUMER COMPLAINT NARRATIVE VARCHAR2(100) .

Please try below query:

CREATE TABLE CONSUMER_COMPLAINTS
(
    DATE_RECEIVED STRING,
    PRODUCT_NAME VARCHAR(50),
    SUB_PRODUCT VARCHAR(40),
    ISSUE VARCHAR(100),
    SUB_ISSUE VARCHAR(100),
    CONSUMER_COMPLAINT_NARRATIVE VARCHAR(100),
    Company_Public_Response STRING,
    Company VARCHAR(30),
    State_Name CHAR(4),
    Zip_Code INTEGER,
    Tags VARCHAR(10),
    Consumer_Consent_Provided CHAR(6),
    Submitted_via STRING,
    Date_Sent_to_Company STRING,
    Company_Response_to_Consumer VARCHAR(2),
    Timely_Response CHAR(4),
    CONSUMER_DISPUTED CHAR(4),
    COMPLAINT_ID NUMBER(12,0) NOT NULL PRIMARY KEY
);

huangapple
  • 本文由 发表于 2023年5月11日 02:38:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76221655.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定