Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Wiki Markup
The SAVE command enables committing the loaded TARGIT InMemory Database to the disk and also makes it possible to store a single InMemory table in the file system as either a compressed .targitdb file or as a CSV file.
Note: When building a tiImport script the last command must always SAVE command without any parameters, otherwise the data processed until that point will be discarded.
Syntax:
SAVE \[TABLE _tablename_ TO \{CSV\} {_}'path_in_filesystem'{_}\]
Example:
/* Connect to SQL Server */DATASOURCE sqldb=SQLSERVER 'Server=localhost;Database=StageTCP;Trusted_Connection=True;' 
/* Read all tables from the SQL database – SLURP only works on MS SQL, Access and TARGIT InMemory Database connections */SLURP sqldb
/* Save a single table to a storage location in TARGITDB format, a valid path must be specified */
SAVE TABLE 'salestransactions' TO  'C:\OUTPUT\salestransactions.targitdb'
/* Save a single table as a CSV to a storage location, a valid path must be specified */
SAVE TABLE 'salestransactions' TO CSV 'C:\OUTPUT\salestransaction.csv'
/* Commit entire database to disk */SAVE
\\