This topic is locked

Update Table 2 after Importing Data into Table 1

4/13/2023 7:13:56 AM
PHPRunner Tips and Tricks
C
CWDATA author

Is it possable to import new data into my Primary Table and then automatically update two selected columns from the Primary in a Second Table?
I realise that a Triger is an option but would like to do it from within PHPRunner if possible.
So Primary Table has 5 columns 1, 2, 3, 4 and 5. The Secondaty Table has 2 columns 1 and 2.
Import 5 columns into Primary Table
Then
Update 1 and 2 in Secondary table from 1 And 2 in the Primary Table
Many thanks for reading.

Sergey Kornilov 4/13/2023

You can use BeforeInsert event to execute some additional code when imported data record is about to be inserted into a database:
https://xlinesoft.com/phprunner/docs/before_insert_record.htm
And in that event you can use Database API to insert a record into another table:
https://xlinesoft.com/phprunner/docs/db_insert.htm

C
CWDATA author 4/14/2023

Thank you so much for your prompt reply