Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Part 2 Developing Applications by APIs | > Chapter 11 Developing C Applications | > 11.2 How to Use C APIs | > 11.2.2 Data Searches |
When searching for a particular XML document, do not obtain the entire document immediately. Instead, start by obtaining the partial information that can effectively identify the document. The user can then use this partial information to pick out the desired XML document and obtain detailed information.
To extract an entire XML document, use the record ID (conductor control information and reply record identifiers) that is returned when the partial information is extracted. The entire target XML document can be extracted by specifying this record ID with the ShunSearchRecId function argument.
The following diagram shows the process for using record IDs to obtain entire XML documents.
SHUNHSTMT StmtH; /* Allocate data manipulation handle */ ShunAllocHandle(ConH, &StmtH); (1) /* Specify record ID and execute search */ ShunSearchRecId(StmtH, 1, Rec_Id_In, &Rec_Id_Out, &Data); (2) /* Extract search results */ printf("[Result] = %s\n", Data[0].Data); (3) /* Release data manipulation handle */ ShunFreeHandle(StmtH); (4) |
Allocate the data manipulation handle in advance. Allocate the data manipulation handle in advance by specifying the connection handle to be used as the parent handle in the ShunAllocHandle function.
Specify the data manipulation handle, the number of requested records and, the requested record ID array as parameters of the ShunSearchRecId function, and then execute the search.
By specifying multiple record IDs with the ShunSearchRecId function, multiple XML documents can be obtained at a time.
The ShunSearchRecId function returns the address of the search results.
Search results consist of arrays of structures, so data is extracted from these arrays. If no XML document exists, NULL will be set in the pointer to the element data in the array, and the data size will be set to zero.
After the data search has been performed and the results have been extracted, use the ShunFreeHandle function to release the data manipulation handle.
Contents
Index
![]() ![]() |