masterchef
Programmer
I am getting errors with a MySQL insert query which is puzzling me, it is based on the following query that works perfect.
INSERT INTO selected_product_parent_options (F_ID, NAME) (SELECT {GET.NxT_ID}, NAME FROM parent_options WHERE NAME NOT IN (SELECT NAME FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options))
The problem is in this query
INSERT INTO selected_product_parent_options (F_ID, NAME, LK_ID) (SELECT {GET.NxT_ID}, NAME FROM parent_options WHERE NAME NOT IN (SELECT NAME FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options), ID FROM parent_options WHERE ID NOT IN (SELECT LK_ID FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options) OR NAME FROM parent_options WHERE NAME NOT IN (SELECT NAME FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options))
Error:
SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' ID FROM parent_options WHERE ID NOT IN (SELECT LK_ID FROM selec.
A Big thanks to CognosChicago for all his help with the first query.
Many Thanks to all in advance
IJS
INSERT INTO selected_product_parent_options (F_ID, NAME) (SELECT {GET.NxT_ID}, NAME FROM parent_options WHERE NAME NOT IN (SELECT NAME FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options))
The problem is in this query
INSERT INTO selected_product_parent_options (F_ID, NAME, LK_ID) (SELECT {GET.NxT_ID}, NAME FROM parent_options WHERE NAME NOT IN (SELECT NAME FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options), ID FROM parent_options WHERE ID NOT IN (SELECT LK_ID FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options) OR NAME FROM parent_options WHERE NAME NOT IN (SELECT NAME FROM selected_product_parent_options) OR {GET.NxT_ID} NOT IN (SELECT F_ID FROM selected_product_parent_options))
Error:
SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' ID FROM parent_options WHERE ID NOT IN (SELECT LK_ID FROM selec.
A Big thanks to CognosChicago for all his help with the first query.
Many Thanks to all in advance
IJS