Skip to content
Advertisement

Why don’t these sql statements work together but work when i execute them separately?

CREATE TABLE test_table(id int not null auto_increment PRIMARY KEY, year int, quarter varchar(2), month varchar(3), week int, fiscal_month int, fiscal_week int, bsv int, prod_bsv varchar(50), comp_name_as_is varchar(30), mfg varchar(10), eb varchar(100), invoice_so varchar(50), invoice_no varchar(50), mpn varchar(255), customer_bill_to_name varchar(255), nsb double, rgp double, pre_rgp double, cust_invoice double, invoice_bill_bgp double,invoice_bill_pgp int)

INSERT INTO test_table(year, quarter, month, week, fiscal_month, fiscal_week, bsv, prod_bsv, comp_name_as_is, mfg, eb, invoice_so, invoice_no, mpn, customer_bill_to_name, nsb, rgp, pre_rgp, cust_invoice, invoice_bill_bgp, invoice_bill_pgp)
VALUES (1,  'Q3',   'x',    1,  7,  1,  1,  'x',    'x',    'x',    'x',    'x',    'x',    'x',    ”x”,    1,  1,  1,  1,  1,  1)

Advertisement

Answer

Have you tried putting a semicolon after the first statement? If they work separately but not together it is likely a missing separator.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement