MySQL Forums
Forum List  »  Microsoft Access

MYSQL insert statement help
Posted by: harry boy
Date: October 25, 2010 11:37AM

Hi, sorry if this is in the wrong place.
I have a SQL statement that does not seem to be inserting values into my database.
I have a table called MainTable with columns FAMILY_ID and PERSON_NAME. I want to insert a name into the row only if the FAMILY_ID column equals a certain string value.

The below is not working (value I want to insert is not getting inserted)

string command1 = "INSERT INTO MainTable (PERSON_NAME) VALUES ('" + sName + "') WHERE FAMILY_ID = ('" + sFamilyID + "')";
oleDbCommand.CommandText = command;

Does anyone know whay??

Options: ReplyQuote

Written By
MYSQL insert statement help
October 25, 2010 11:37AM
October 26, 2010 12:51AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.