This section contains examples of the SQL statements used to imports data from a component release files in the appropriate database table. Before importing the tables must be created (see 5.2. Creating Tables for Components and 5.3. Creating Tables for Reference Sets).
The code shown below provides illustrative examples only. For full details download an review the import script. For details see A.1 Download the SNOMED CT Example Database Package. |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Concept_Full_INT_[RELEASE-DATE].txt' INTO TABLE `full_concept` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`definitionStatusId`); |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Description_Full-en_INT_[RELEASE-DATE].txt' INTO TABLE `full_description` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`conceptId`,`languageCode`,`typeId`,`term`,`caseSignificanceId`); |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Relationship_Full_INT_[RELEASE-DATE].txt' INTO TABLE `full_relationship` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`sourceId`,`destinationId`,`relationshipGroup`,`typeId`,`characteristicTypeId`,`modifierId`); |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Content/der2_Refset_SimpleFull_INT_[RELEASE-DATE].txt' INTO TABLE `full_refset_simple` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`refSetId`,`referencedComponentId` ); |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Language/der2_cRefset_LanguageFull-en_INT_$RELDATE.txt' INTO TABLE `full_refset_Language` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`refsetId`,`referencedComponentId`,`acceptabilityId`); |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Map/der2_iisssccRefset_ExtendedMapFull_INT_$RELDATE.txt' INTO TABLE `full_refset_ExtendedMap` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`refsetId`,`referencedComponentId`,`mapGroup`,`mapPriority`,`mapRule`,`mapAdvice`,`mapTarget`,`correlationId`,`mapCategoryId`); |
The code shown below provides illustrative examples only to show the minor difference between the code for importing the snapshot compared to the full release. For full details download an review the import script. For details see A.1 Download the SNOMED CT Example Database Package. |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Snapshot/Terminology/sct2_Concept_Snapshot_INT_[RELEASE-DATE].txt' INTO TABLE `snap_concept` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`definitionStatusId`); |
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Snapshot/Refset/Content/der2_Refset_SimpleSnapshot_INT_[RELEASE-DATE].txt' INTO TABLE `snap_refset_simple` LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`id`,`effectiveTime`,`active`,`moduleId`,`refSetId`,`referencedComponentId`); |