XML과 관계형 데이타베이스 매핑을 통한 자료의 변환

Data Transformation through Mapping between XML and Relation Database

  • 김길준 (성결대학교 전자상거래학부)
  • 발행 : 2004.12.01

초록

XML과 데이터베이스간의 자료 변환의 원리는 XML과 데이터베이스 간 매칭의 원리로 이루어진다. SQL Server의 데이터에 접근하기 위한 방법은 URL에 SQL 쿼리를 지정하는 방법과 template 파일을 이용하는 방법이 있다. MS-SQL 서버는 OpenXML 기능을 이용하여 기존의 관계형 데이터베이스에 대해 SQL 쿼리를 실행한 결과를 XML 문서로 변환한다. 즉, OpenXML은 노드 트리를 생성한 후에 XML 문서의 로우셋 데이터를 반환하고, XML 데이터를 관계형 형식으로 얻게 한다. XML 데이터를 데이터베이스 데이터로 삽입하기 위해서는 sp_xml_preparedocument 프로시져를 사용하여, XML 문서를 파싱해 데이터를 추출한 후. 그 문서의 노드 구조를 메모리의 트리 구조로 매핑해서 데이터베이스 테이블에 저장하게 된다. 결국 XML과 데이터베이스간의 자료 변환의 원리는 XML과 데이터베이스간 매칭의 원리로 이루어진다. 본 논문에서는 매핑 원리를 제시한 후 SQL Server의 지원하에 두 자료간의 변환을 구현해 보임으로서 자료의 확장성과 효율성 및 다양한 효과를 가져올 수 있음을 제시하고 있다.

The data transformation between XML and Relation Database is made through the Principle of mapping bewtween them. There are two ways to access SQL Server, one is to assign SQL query to URL and the other is to use template file. MS-SQL server takes advantage of OpenXML function to transform the results of executing SQL query into XML documents. That is, OpenXML first makes node tree and then transforms row set data of XML documents into XML data of relation type. In order to insert XML data into database data. data is extracted from parsing XML documents using sp_xml_preparedocument procedure, and then the document structure is mapped into tree structure and stored in a table of database. Consequently, Data transformation between XML and Relation Database is made through mapping bewtween them. This article proposes the principle of mapping between XML and Relation Database and then shows the implementation of transformation between them so that it introduces the possibilty of bringing the extension and efficiency of data and various effects.

키워드