Scalable Database Server, HiRDB Version 8 Command Reference
This section presents an example of table reorganization using a UOC.
The example of UOC coding shown here is provided as a sample database. It is stored in the directory %PDDIR%\sample\sampleUOC.
During table reorganization, this example deletes data whose database registration date is year 2001 or earlier.
CREATE TABLE MEMBVER_DIRECTORY (MEMBER_NUMBER INTEGER,
MEMBER_NAME NCHAR(20),
MEMBER_ADDRESS NVARCHAR(100),
JOINED_DATE_AND_TIME DATE NOT NULL WITH DEFAULT);
pdrorg -k rorg -t MEMBVER_DIRECTORY control-information-file |
unload unload-data-file-name uoc_lib=library-name unlduoc entry=old_data_delete |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <pdutluoc.h> ..........................................................1
void old_data_delete (
UTL_UOC_INF *uocinf /* A(UOC interface area) */ ...2
) {
UTL_UOC_DATA_BUF *addr_list; /* A(data address list) */
unsigned char *date_adr; /* A(DATE) */
static unsigned char cyear[2]; /* compare year */
switch(uocinf->req_cd){ ....................................................3
case UTL_UOC_START:
/*
|
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.