Zymonic Toolkit System: Difference between revisions
Content added Content deleted
(Created page with "==Synchronize_csv== Command general info This is a new toolkit command which replaces “upload_csv” called “synchronize_csv”. New command can be used to relatively q...") |
(Tidied article to make parameters clearer.) |
||
Line 11: | Line 11: | ||
sudo zymonic_toolkit.pl System synchronize_csv [parameters below] |
sudo zymonic_toolkit.pl System synchronize_csv [parameters below] |
||
<table style="width:100%"> |
|||
<tr> |
|||
Required parameters |
|||
<th colspan="2">Required Parameters</th> |
|||
</tr> |
|||
⚫ | |||
<tr> |
|||
⚫ | |||
<th>Parameter Name</th> |
|||
--field_sequence - Comma delimited list of field znames in the order the data appears in the csv |
|||
<th>Parameter Description</th> |
|||
⚫ | |||
</tr> |
|||
⚫ | |||
<tr align="left"> |
|||
⚫ | |||
<td>system</td> |
|||
⚫ | |||
</tr> |
|||
Optional parameters: |
|||
<tr align="left"> |
|||
<td>table_zname</td> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
</tr> |
|||
⚫ | |||
<tr align="left"> |
|||
⚫ | |||
<td>field_sequence</td> |
|||
⚫ | |||
<td>Comma delimited list of field znames in the order the data appears in the csv</td> |
|||
</tr> |
|||
⚫ | |||
<tr align="left"> |
|||
⚫ | |||
<td>csv_path</td> |
|||
⚫ | |||
⚫ | |||
</tr> |
|||
<tr align="left"> |
|||
<td>username</td> |
|||
⚫ | |||
</tr> |
|||
<tr align="left"> |
|||
<td>zpass</td> |
|||
⚫ | |||
</tr> |
|||
<tr> |
|||
<th colspan="2">Optional Parameters</th> |
|||
</tr> |
|||
<tr> |
|||
<th>Parameter Name</th> |
|||
<th>Parameter Description</th> |
|||
</tr> |
|||
<tr align="left"> |
|||
<td>state</td> |
|||
⚫ | |||
</tr> |
|||
<tr align="left"> |
|||
<td>keyfields</td> |
|||
⚫ | |||
</tr> |
|||
<tr align="left"> |
|||
<td>delete_others</td> |
|||
⚫ | |||
</tr> |
|||
<tr align="left"> |
|||
<td>update_type</td> |
|||
⚫ | |||
⚫ | |||
* Update – update records in the table matching the csv based on the keyfields supplied |
|||
⚫ | |||
⚫ | |||
</tr> |
|||
<tr align="left"> |
|||
<td>batch_size</td> |
|||
⚫ | |||
</tr> |
|||
</table> |
Revision as of 13:06, 27 May 2020
Synchronize_csv
Command general info
This is a new toolkit command which replaces “upload_csv” called “synchronize_csv”. New command can be used to relatively quickly: insert, update, update/insert and delete records in a Zymonic table based on a csv. Usage is as follows.
Usage
sudo zymonic_toolkit.pl System synchronize_csv [parameters below]
Required Parameters | |
---|---|
Parameter Name | Parameter Description |
system | System the destination table is in |
table_zname | ZName of destination table to be altered |
field_sequence | Comma delimited list of field znames in the order the data appears in the csv |
csv_path | File path to the csv file with the data |
username | Username for the systems GUI |
zpass | Corresponding password for the username |
Optional Parameters | |
Parameter Name | Parameter Description |
state | State to set the inserted records to for the GUI. Most likely should be the state saved records are set to. |
keyfields | Comma delimited list of fields to be used to match existing records in the table when updating/deleting. May be primary key, or a list of fields which combined are unique. Not needed for Insert. |
delete_others | Defaults to no. If set to “yes”, will set records from the table which aren’t in the csv file as deleted. |
update_type | Defaults to “Insert”. Mode to run the command in options:
|
batch_size | Defaults to 100. Varies the size batch that the code passes the data through in internally only changes performance, 100 was found to be a good number. |