sql >> データベース >  >> RDS >> Oracle

ORA-00933:複数行の挿入時にSQLコマンドが正しく終了しませんでした

    ドキュメント values の閉じ括弧の後に逆矢印がないことがわかります。 .

    2 つのソリューション。 2 つの 挿入 s:

    INSERT INTO CAMPAIGN (CAMPAIGN_ID, SHOP_ID, CAMPAIGN_TYPE, SORT_ORDER, STATUS, VALID_FROM, VALID_TILL, CREATED_AT, MODIFIED_AT, CUSTOM_GRID_LAYOUT_CSS, IMAGE_URL, KEY, SHOW_PRODUCTS_FILTER, MOBILE_APP_IMAGE_URL, LAYOUT_ID, SHOW_OWN_BRAND, VALIDATION_STATUS, CAMPAIGN_USAGE_ID, STORE_END_DATE, PAGING_ALLOWED, CAROUSEL_BUTTON_TEXT_COLOR, CAROUSEL_BUTTON_BG_COLOR, CAROUSEL_BUTTON1_LABEL, CAROUSEL_BUTTON1_URL, CAROUSEL_BUTTON2_LABEL, CAROUSEL_BUTTON2_URL, CAROUSEL_HTML_OVERLAY, MOBILE_APP_TEASER_URL, CAROUSEL_CLAIM_URL, CAROUSEL_HERO_URL, CAROUSEL_BOX_COLOR, AVOID_CAMPAIGN_NAV_TEASER, CAROUSEL_BUTTON1_NEW_TAB, CAROUSEL_BUTTON2_NEW_TAB, SALE_QUALIFICATION_ID, SALE_TARGET_CAMPAIGN) VALUES (CAMPAIGN_SEQ.nextval, 1, 'C', 0, 'A', to_date('2016-11-23', 'YYYY-MM-DD'), to_date('2116-11-23', 'YYYY-MM-DD'), to_date('2016-11-23', 'YYYY' -MM-DD'), to_date('2018-07-02', 'YYYY-MM-DD'), null, null, null, 1, null, '5_COL', 0, null, 4, to_date('2116 -11-23', 'YYYY-MM-DD'), 0, null, null, 'アーティケルab Mo., 0​​2.12.', 'https://www.lidl.de', null, null, null, null, null, null, null, 0, 0, 0, null, 0);INSERT INTO CAMPAIGN (CAMPAIGN_ID , SHOP_ID, CAMPAIGN_TYPE, SORT_ORDER, STATUS, VALID_FROM, VALID_TILL, CREATED_AT, MODIFIED_AT, CUSTOM_GRID_LAYOUT_CSS, IMAGE_URL, KEY, SHOW_PRODUCTS_FILTER, MOBILE_APP_IMAGE_URL, LAYOUT_ID, SHOW_OWN_BRAND, VALIDATION_STATUS, CAMPAIGN_USAGE_ID, STORE_END_DATE, PAGING_ALLOWED, CAROUSEL_BUTTON_TEXT_COLOR, CAROUSEL_BUTTON_BG_COLOR, CAROUSEL_BUTTON1_LABEL, CAROUSEL_BUTTON1_URL, CAROUSEL_BUTTON2_LABEL, CAROUSEL_BUTTON2_URL , CAROUSEL_HTML_OVERLAY, MOBILE_APP_TEASER_URL, CAROUSEL_CLAIM_URL, CAROUSEL_HERO_URL, CAROUSEL_BOX_COLOR, AVOID_CAMPAIGN_NAV_TEASER, CAROUSEL_BUTTON1_NEW_TAB, CAROUSEL_BUTTON2_NEW_TAB, SALE_QUALIFICATION_ID, SALE_TARGET_CAMPAIGN) VALUES (CAMPAIGN_SEQ.nextval, 1, 'P', 0, 'A', to_date('2016-11-09', ' YYYY-MM-DD')、to_date('2116-11-09'、'YYYY-MM-DD')、to_date('2016-11-09'、'YYYY-MM-DD')、to_date('2018 -07-02', 'YYYY-MM-DD'), null, null, null, 0、ヌル、「4_COL_LEFT_NAV」、1、ヌル、ヌル、ヌル、1、ヌル、ヌル、ヌル、ヌル、ヌル、ヌル、ヌル、ヌル、ヌル、ヌル、0、0、0、ヌル、0);  

    または、SELECT を使用します /UNION ALL :

    INSERT INTO CAMPAIGN (CAMPAIGN_ID, SHOP_ID, CAMPAIGN_TYPE, SORT_ORDER, STATUS, VALID_FROM, VALID_TILL, CREATED_AT, MODIFIED_AT, CUSTOM_GRID_LAYOUT_CSS, IMAGE_URL, KEY, SHOW_PRODUCTS_FILTER, MOBILE_APP_IMAGE_URL, LAYOUT_ID, SHOW_OWN_BRAND, VALIDATION_STATUS, CAMPAIGN_USAGE_ID, STORE_END_DATE, PAGING_ALLOWED, CAROUSEL_BUTTON_TEXT_COLOR, CAROUSEL_BUTTON_BG_COLOR, CAROUSEL_BUTTON1_LABEL, CAROUSEL_BUTTON1_URL, CAROUSEL_BUTTON2_LABEL, CAROUSEL_BUTTON2_URL, CAROUSEL_HTML_OVERLAY, MOBILE_APP_TEASER_URL, CAROUSEL_CLAIM_URL, CAROUSEL_HERO_URL, CAROUSEL_BOX_COLOR, AVOID_CAMPAIGN_NAV_TEASER, CAROUSEL_BUTTON1_NEW_TAB, CAROUSEL_BUTTON2_NEW_TAB, SALE_QUALIFICATION_ID, SALE_TARGET_CAMPAIGN) SELECT CAMPAIGN_SEQ.nextval, 1, 'C', 0, 'A', to_date ('2016-11-23', 'YYYY-MM-DD'), to_date('2116-11-23', 'YYYY-MM-DD'), to_date('2016-11-23', 'YYYY- MM-DD'), to_date('2018-07-02', 'YYYY-MM-DD'), null, null, null, 1, null, '5_COL', 0, null, 4, to_date('2116- 11-23'、'YYYY-MM-DD')、0、null、null、'アーティケルab Mo., 0​​2.12.', 'https://www.lidl.de', null, null, null, null, null, null, null, 0, 0, 0, null, 0 FROM dual UNION ALL SELECT CAMPAIGN_SEQ. nextval, 1, 'P', 0, 'A', to_date('2016-11-09', 'YYYY-MM-DD'), to_date('2116-11-09', 'YYYY-MM-DD' ), to_date('2016-11-09', 'YYYY-MM-DD'), to_date('2018-07-02', 'YYYY-MM-DD'), null, null, null, 0, null, '4_COL_LEFT_NAV', 1, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, 0, 0, 0, null, 0 FROM dual;  


    1. MySQLの行を更新するためのクエリの更新

    2. Symfony2のテーブルに参加する

    3. PHPおよびSQLを介したXMLの出力

    4. Pythonのmysqlでプリペアドステートメントを使用する