Question

Can a T-Table Import be automated To Run On A Schedule?

  • 31 January 2024
  • 3 replies
  • 89 views

Badge +1

Our system has a large number of stock records for items that when they reach a count of 0, aren’t likely to be used again for months or years. We have an SQL statement to find these records and remove them from our stock table to clean it up so we don’t have thousands of empty rows to search through when running other queries. Rather than directly modifying a crucial table like ‘stock’ we opted to add them in a T-Table called ‘t_stock’ with the delete modifier. We then run a T-Import to delete these rows as a safer alternative, and also to trigger any business rules when they are modified.

 

We are able to schedule the SQL query to run on a set schedule say, every night at 11pm.

Is it possible to schedule a T-Import for this table to run at a similar time so it doesn’t have to be manually run? What other solutions might be possible when working with such a critical table?

 


3 replies

Userlevel 4
Badge +12

Hi @gdfkjones ,

Could you share more information about the sql queries and the steps which you have implemented if possible? Not exactly sure about your requirement here, but I hope you are aware of the perform definition message called perform_import_from_t_table to import data from t-tables in which you can run in scheduled processes.

<perform_import_from_t_table>
  <parameters>
    <tablename /> <!-- table name for importing -->
    <updatetype /> <!-- update type : "insert/update/insert_update/delete" -->
  </parameters>
</perform_import_from_t_table>

Badge +1

Hi @gdfkjones ,

Could you share more information about the sql queries and the steps which you have implemented if possible? Not exactly sure about your requirement here, but I hope you are aware of the perform definition message called perform_import_from_t_table to import data from t-tables in which you can run in scheduled processes.

<perform_import_from_t_table>
  <parameters>
    <tablename /> <!-- table name for importing -->
    <updatetype /> <!-- update type : "insert/update/insert_update/delete" -->
  </parameters>
</perform_import_from_t_table>

 

Could you link me to a resource where I can learn more about the syntax for the FSM XML imports? I tried what you suggested and the import did not complete. 

Badge +1

The solution that worked was the code below:

<perform_import_from_t_table>
  <parameters>
    <tablename>STOCK</tablename>
  </parameters>
</perform_import_from_t_table>

 

Since the import was completely barebones no additional code was needed for this under the scheduled processes menu. The counterintuitive piece here was referring to the table STOCK to run the import, rather than the T-Table with the actual changes on it, T_STOCK. 

Reply