Topic: save a same datafield into two diffrent data base table

sir any script for saving a particular text field (form1.edit1) into two diffrent database table  click a single button.



database table name: table1 and table2
datafield :  d1 and d2 respectevly

Re: save a same datafield into two diffrent data base table

procedure frmEmployee_Button2_OnClick (Sender: string; var Cancel: boolean);
begin
    SQLExecute ('INSERT INTO table1 (d1) VALUES ('+ frmEmployee.Edit1.sqlValue +')');
    SQLExecute ('INSERT INTO table2 (d2) VALUES ('+ frmEmployee.Edit1.sqlValue +')');

    Form1.TableGrid1.dbUpdate;
    Form1.TableGrid2.dbUpdate;
    frmEmployee.Close;
end;


Also i made example for you, please download here:

Post's attachments

Attachment icon SQL insert in two tables.zip 4.89 kb, 807 downloads since 2014-11-18 

Dmitry.

Re: save a same datafield into two diffrent data base table

sir one more help.any sql script for showing more than two database table fields in a single table grid result.

eg; when click button2,
show table1, table2, table3 data in serach grid(table grid)