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

Part 1 The Basic for Developing Application> Chapter 6 Direct Access Function> 6.6 Updating Data by Direct Access Key

6.6.3 For C API

The ShunUpdateKey function is used in the direct update for C API.

The following figure shows a flow of the direct update for C API.

[Figure 6-14 A flow of the Direct Update]

mark1Sample Code

/* This program assumes that the following variables have been declared        */
/* updateData : Update data                                 */
/* pKey       : Structure array for setting the direct access keys */

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

/* Use direct access key to perform update */
pKey[0].Key = "20061101,00000001";                                               (1)
pKey[0].Key_Len = strlen( pKey[0].Key );
pKey[1].Key = "20061101,00000002";                                               (1)
pKey[1].Key_Len = strlen( pKey[1].Key );
pKey[2].Key = "20061101,00000003";                                               (1)
pKey[2].Key_Len = strlen( pKey[2].Key );
ShunUpdateKey(StmtH, "key1", SHUN_KEY_COMPLETE_MATCH, 3, pKey, updateData);      (2)

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

mark2(1) Set the Direct Access

Set the direct access key at the SHUNKEY structure.

mark2(2) Update the XML Document

Specify the data manipulation handle, the direct access key name, the number of the data to be updated, the direct access key being updated and the data to be updated as the ShunUpdateKey function, and then execute the update.

Specifying multiple direct access keys and the data to be updated with the ShunUpdateKey function to update multiple XML documents at a time.

Refer to J.3.4 Update Data Using Direct Access Key for the sample program of the direct access.

Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006