cuetzpalin
Programmer
Hello,
I have a simple question which I can't figure out! I have to insert a row into a table based on a select query results of another table. However, on some rare occasions the data doesn't exist in the select statement table therefore nothing is inserted into the table. I would like to know if you could help me create an "else" scenario.
Here's my basic insert:
INSERT INTO MAIN_TABLE_HEADER
SELECT NAME FROM MEMBERS WHERE MEM_ID = '&MID';
&MID is my variable.
So, if doesn't return any results I would still like it it populate my HEADER table with "Member not found".
Thank you in advance!
- Eddie
I have a simple question which I can't figure out! I have to insert a row into a table based on a select query results of another table. However, on some rare occasions the data doesn't exist in the select statement table therefore nothing is inserted into the table. I would like to know if you could help me create an "else" scenario.
Here's my basic insert:
INSERT INTO MAIN_TABLE_HEADER
SELECT NAME FROM MEMBERS WHERE MEM_ID = '&MID';
&MID is my variable.
So, if doesn't return any results I would still like it it populate my HEADER table with "Member not found".
Thank you in advance!
- Eddie