CのOUTMODルーチンの生成 - FastExport

Teradata® FastExport リファレンス

Product
FastExport
Release Number
17.00
Published
2020年6月
Language
日本語
Last Update
2021-01-07
dita:mapPath
ja-JP/ups1544831946863.ditamap
dita:ditavalPath
ja-JP/ups1544831946863.ditaval
dita:id
B035-2410
Product Category
Teradata Tools and Utilities

以下に挙げるのは、FastExportユーティリティ ソフトウェアに付属のサンプルOUTMODルーチンfeomod.cのリストです。

   #include <stdio.h>
   #include <stdlib.h>
   /**********************************************************************/
   /*                                                                    */
   /* feomod.c   - Sample Outmod for FastExport.                         */
   /*                                                                    */
   /* Purpose    - This outmod deletes the data passed to it.            */
   /*                                                                    */
   /* Execute    - Build Outmod on a UNIX operating system               */
   /*                compile and link into shared object                 */
   /*                    cc -G feomod.c - o feomod.so                    */
   /*                                                                    */
   /*            - Build Outmod on a Win32 system                        */
   /*                compile and link into dynamic link library          */
   /*                    cl /DWIN32 /LD feomod.c                         */
   /*                                                                    */
   /*  Copyright (C) 1996-2012 by Teradata Corporation.                  */
   /*  All Rights Reserved.                                              */
   /*  Teradata Corporation CONFIDENTIAL AND TRADE SECRET                */
   /*                                                                    */
   /**********************************************************************/                        
   typedef unsigned short     Int16;
   typedef unsigned char      Int8;
   typedef unsigned int UInt32;
   #ifdef WIN32 /* Change for WIN32 */
   __declspec(dllexport) UInt32 _dynamn( int *code,
                                         int *stmno,
                                         int *InLen,
                                         char *InBuf,
                                         int *OutLen,
                                         char *OutBuf
                                   )
#else
UInt32 _dynamn(code, stmno, InLen, InBuf, OutLen, OutBuf)
   int     *code;
   int     *stmno;
   int     *InLen;
   char    *InBuf;
   int     *OutLen;
   char    *OutBuf;
   #endif

   
   {
   /* case on entry code
   */
   switch (*code) {                                                                                
    case 1:  /* Initialization, no other values */
      printf ("OUTMOD Initial Entry\n");
      break;
    case 2:  /* Cleanup call, no other values */
      printf ("OUTMOD End of Responses Entry\n");
      break;
    case 3:  /* Process response record */
      *InLen=0;
      *OutLen=0;
      break;
    case 4:
      /* Checkpoint, no other values */
      printf ("OUTMOD Checkpoint Entry\n");
      break;
    case 5:
      /* DBC restart - close and reopen the output files */
      printf ("OUTMOD DBC Restart Entry\n");
      break;
    case 6:
      /* Host restart  */
      printf ("OUTMOD Host Restart Entry\n");
      break;
    default:
      printf ("OUTMOD Invalid Entry code\n");
      break;                                                                                      
     }
    return (0);
   }