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.3 Updating Data by Specifying Record IDs

Use the ShunUpdateRecId function to update XML documents.

The ShunUpdateRecId function uses record IDs (conductor control information and reply record identifiers) to update data. Before executing the ShunUpdateRecId function, use the ShunSearch function to obtain the record IDs of the data to be updated. The process of using a record ID to update an XML document refers to replacing an existing XML document with a new XML document. It is not possible to update part of the data contained in an existing XML document.

The following diagram shows the process for updating data by specifying record IDs.

[Figure 11-25 Process for Updating Data by Specifying Record IDs]

mark1Sample Code

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

/* Use record ID to perform update */
ShunUpdateRecId(StmtH, 1, Rec_Id_In, 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) Update XML Documents

Perform the update process by specifying the data manipulation handle, the number of data items to be updated, the record IDs to be updated, and the data to be updated in the ShunUpdateRecId function.

By specifying multiple record IDs and their corresponding data with the ShunUpdateRecId function, multiple XML documents can be updated at a time.

mark2(3) Release Data Manipulation Handle

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


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006