Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX -
Contents Index PreviousNext

Part 2 Developing Applications by APIs> Chapter 11 Developing C Applications> 11.2 How to Use C APIs> 11.2.3 Updating Data

11.2.3.1 Adding Data

Use the ShunInsert function to add data.

The following diagram shows process for adding data.

[Figure 11-23 Process for Adding Data]

mark1Sample Code

SHUNHSTMT StmtH;
/* Allocate data manipulation handle*/
ShunAllocHandle(ConH, &StmtH);                             (1)

/* Add XML documents */
SHUNDATA Data[1];
Data[0].Data =
  "<document>"
  "    <base>"
         :
  "    </base>"
  "    <information>"
         :
  "    </information>"
  "</document>";
Data[0].Data_Len = strlen( Data[0].Data );
ShunInsert(StmtH, 1, Data);                                (2)

/* Release data manipulation handle */
ShunFreeHandle(StmtH);                                     (3)

mark2(1) Allocate Data Manipulation Handle

Allocate the data manipulation handle in advance by specifying the connection handle to be used as the parent handle in the ShunAllocHandle function.

mark2(2) Add XML Documents

To add XML documents, specify the data manipulation handle, the number of data items to be added, and the XML documents to be added in the ShunInsert function.

The ShunInsert function can be used to add multiple XML documents at a time. Either of the following specification methods can be used.

mark2(3) Release Data Manipulation Handle

After data addition is complete, use the ShunFreeHandle function to release the data manipulation handle.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006