I have a table where the users send reviews, this review is stored in a tempo table, when I aprove the review I need to copy the record data in table1 (tempo) to table2.
I´m doing this with delphi, I have tryed to use the TmyScript component but I can´t make the recovering of the fields content.
¿Can somebody help me?
How can I copy a record from one table to another
-
Guest
I´m trying to use the following code, and I supose it will work, but I wonder if ther isn´t an easyer way to do the same.
MyCommand1.SQL.Text := 'insert into reviews values (NULL,'''+
QReviews_Add.Fieldbyname('date').AsString +''','''+
QReviews_Add.FieldByName('title').AsString +''','''+
QReviews_Add.FieldByName('text').AsString +''','''+
QReviews_Add.FieldByName('reviewer').AsString +''','''+
QReviews_Add.FieldByName('email').AsString +''','''+
QReviews_Add.FieldByName('score').AsString +''','''+
'1'','''+
QReviews_Add.FieldByName('url').AsString +''','''+
'1'','''+
QReviews_Add.FieldByName('rlanguage').AsString+
''')';
Memo1.Text := MyCommand1.SQL.Text;
MyCommand1.Execute;
MyCommand1.SQL.Text := 'insert into reviews values (NULL,'''+
QReviews_Add.Fieldbyname('date').AsString +''','''+
QReviews_Add.FieldByName('title').AsString +''','''+
QReviews_Add.FieldByName('text').AsString +''','''+
QReviews_Add.FieldByName('reviewer').AsString +''','''+
QReviews_Add.FieldByName('email').AsString +''','''+
QReviews_Add.FieldByName('score').AsString +''','''+
'1'','''+
QReviews_Add.FieldByName('url').AsString +''','''+
'1'','''+
QReviews_Add.FieldByName('rlanguage').AsString+
''')';
Memo1.Text := MyCommand1.SQL.Text;
MyCommand1.Execute;