Newbee INSERT Delphi 6
Posted: Wed 01 Feb 2006 14:34
Dear,
I am making a conversion program for the Advantage data format tables to MySQL
It works quite well but it is not elegant.
Can someone give a comment on the following code:
MyConnection and myQuery Q1 on a form
In a loop the program does:
1 Q1.Close
2 Q1.SQL.Clear
3 Q1.SQL.Add('INSERT INTO TableName VALUES ("1","2","3");');
4 Q1.Execute
It works fine
Why can't I repat line 3 in this program?
3 Q1.SQL.Add('INSERT INTO TableName VALUES ("1","2","3");');
3 Q1.SQL.Add('INSERT INTO TableName VALUES ("5","6","7")');
3 etc.
4 Q1.Execute
Any comments? Please, let me know
Bij the way is there a way to find out if a tableName already exists in the database?
I used Table1.TableName:= A_name; a_boolean:= Table1.Exists;
Thanks for your attention Teunis
I am making a conversion program for the Advantage data format tables to MySQL
It works quite well but it is not elegant.
Can someone give a comment on the following code:
MyConnection and myQuery Q1 on a form
In a loop the program does:
1 Q1.Close
2 Q1.SQL.Clear
3 Q1.SQL.Add('INSERT INTO TableName VALUES ("1","2","3");');
4 Q1.Execute
It works fine
Why can't I repat line 3 in this program?
3 Q1.SQL.Add('INSERT INTO TableName VALUES ("1","2","3");');
3 Q1.SQL.Add('INSERT INTO TableName VALUES ("5","6","7")');
3 etc.
4 Q1.Execute
Any comments? Please, let me know
Bij the way is there a way to find out if a tableName already exists in the database?
I used Table1.TableName:= A_name; a_boolean:= Table1.Exists;
Thanks for your attention Teunis