Difference between revisions of "Custom SQL Script"
From CaseTalk Wiki
(Created page with "= Custom Script = The custom script is a sql script in which the database may be extended and/or data transformed. CaseTalk itself does not use any additional tables or views...") |
m (→Custom Script) |
||
Line 3: | Line 3: | ||
This script is fired after every sql transaction that CaseTalk applies to the repository. | This script is fired after every sql transaction that CaseTalk applies to the repository. | ||
-- | |||
DROP VIEW IF EXISTS $SCHEMA$.MyLabelTypes; | |||
-- | |||
CREATE VIEW $SCHEMA$.MyLabelTypes AS | |||
SELECT OTFTNAME as LabelType | |||
FROM $SCHEMA$.OTFT | |||
WHERE TYPE='L' | |||
The previous script is simply provided to illustrate a sqlite script which can be used to extract all label types into a distinct view, and will be exported in CSV, XLS, etc, along with all the other tables in which the model is stored. | |||
Naturally this can be joined with information from the custom attributes table. |
Revision as of 15:47, 26 January 2018
Custom Script
The custom script is a sql script in which the database may be extended and/or data transformed. CaseTalk itself does not use any additional tables or views which may be created, yet does export them as part of the model repository tables.
This script is fired after every sql transaction that CaseTalk applies to the repository.
-- DROP VIEW IF EXISTS $SCHEMA$.MyLabelTypes; -- CREATE VIEW $SCHEMA$.MyLabelTypes AS SELECT OTFTNAME as LabelType FROM $SCHEMA$.OTFT WHERE TYPE='L'
The previous script is simply provided to illustrate a sqlite script which can be used to extract all label types into a distinct view, and will be exported in CSV, XLS, etc, along with all the other tables in which the model is stored.
Naturally this can be joined with information from the custom attributes table.