📄 pcs_snd_zfjb1.c
字号:
/* Result Sets Interface */
#ifndef SQL_CRSR
# define SQL_CRSR
struct sql_cursor
{
unsigned int curocn;
void *ptr1;
void *ptr2;
unsigned long magic;
};
typedef struct sql_cursor sql_cursor;
typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */
/* Thread Safety */
typedef void * sql_context;
typedef void * SQL_CONTEXT;
/* File name & Package Name */
struct sqlcxp
{
unsigned short fillen;
char filnam[17];
};
static struct sqlcxp sqlfpn =
{
16,
"Pcs_Snd_ZFJB1.pc"
};
static unsigned long sqlctx = 5117443;
static struct sqlexd {
unsigned int sqlvsn;
unsigned int arrsiz;
unsigned int iters;
unsigned int offset;
unsigned short selerr;
unsigned short sqlety;
unsigned int unused;
short *cud;
unsigned char *sqlest;
char *stmt;
unsigned char **sqphsv;
unsigned int *sqphsl;
short **sqpind;
unsigned int *sqparm;
unsigned int **sqparc;
unsigned char *sqhstv[5];
unsigned int sqhstl[5];
short *sqindv[5];
unsigned int sqharm[5];
unsigned int *sqharc[5];
} sqlstm = {8,5};
/* Prototypes */
extern sqlcxt (/*_ void **, unsigned long *,
struct sqlexd *, struct sqlcxp * _*/);
extern sqlcx2t(/*_ void **, unsigned long *,
struct sqlexd *, struct sqlcxp * _*/);
extern sqlbuft(/*_ void **, char * _*/);
extern sqlgs2t(/*_ void **, char * _*/);
extern sqlorat(/*_ void **, unsigned long *, void * _*/);
/* Forms Interface */
static int IAPSUCC = 0;
static int IAPFAIL = 1403;
static int IAPFTL = 535;
extern void sqliem(/*_ char *, int * _*/);
static char *sq0007 =
"select SJBH from T_SJBH where (SJBH<>'99' and SJBH<>:b0) ";
typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;
typedef struct { unsigned short len; unsigned char arr[1]; } varchar;
/* cud (compilation unit data) array */
static short sqlcud0[] =
{8,4130,
2,0,0,1,0,0,32,72,0,0,0,0,1,0,
16,0,0,2,0,0,27,154,0,3,3,0,1,0,1,9,0,0,1,9,0,0,1,10,0,0,
42,0,0,3,0,0,31,160,0,0,0,0,1,0,
56,0,0,4,47,0,4,216,0,1,0,0,1,0,2,3,0,0,
74,0,0,5,48,0,3,219,0,1,1,0,1,0,1,3,0,0,
92,0,0,6,71,0,4,222,0,2,1,0,1,0,2,3,0,0,1,97,0,0,
114,0,0,7,68,0,9,230,0,1,1,0,1,0,1,97,0,0,
132,0,0,7,0,0,13,237,0,1,0,0,1,0,2,97,0,0,
150,0,0,8,53,0,3,243,0,3,3,0,1,0,1,97,0,0,1,3,0,0,1,3,0,0,
176,0,0,7,0,0,15,248,0,0,0,0,1,0,
190,0,0,9,0,0,31,258,0,0,0,0,1,0,
204,0,0,10,56,0,4,269,0,1,0,0,1,0,2,97,0,0,
222,0,0,11,37,0,3,283,0,2,2,0,1,0,1,3,0,0,1,3,0,0,
244,0,0,12,0,0,31,293,0,0,0,0,1,0,
258,0,0,13,67,0,4,304,0,3,2,0,1,0,2,3,0,0,1,97,0,0,1,3,0,0,
284,0,0,14,49,0,2,306,0,2,2,0,1,0,1,97,0,0,1,3,0,0,
306,0,0,15,0,0,29,307,0,0,0,0,1,0,
320,0,0,16,51,0,3,341,0,5,5,0,1,0,1,97,0,0,1,97,0,0,1,97,0,0,1,3,0,0,1,3,0,0,
354,0,0,17,46,0,3,345,0,5,5,0,1,0,1,97,0,0,1,3,0,0,1,97,0,0,1,97,0,0,1,3,0,0,
388,0,0,18,0,0,29,374,0,0,0,0,1,0,
402,0,0,19,0,0,31,386,0,0,0,0,1,0,
416,0,0,20,67,0,4,388,0,3,2,0,1,0,2,3,0,0,1,97,0,0,1,3,0,0,
442,0,0,21,49,0,2,390,0,2,2,0,1,0,1,97,0,0,1,3,0,0,
464,0,0,22,72,0,4,392,0,3,2,0,1,0,2,3,0,0,1,97,0,0,1,3,0,0,
490,0,0,23,54,0,2,394,0,2,2,0,1,0,1,97,0,0,1,3,0,0,
512,0,0,24,48,0,2,396,0,2,2,0,1,0,1,3,0,0,1,97,0,0,
534,0,0,25,50,0,2,397,0,2,2,0,1,0,1,3,0,0,1,97,0,0,
556,0,0,26,0,0,29,398,0,0,0,0,1,0,
570,0,0,27,42,0,5,409,0,1,1,0,1,0,1,3,0,0,
588,0,0,28,0,0,29,411,0,0,0,0,1,0,
602,0,0,29,0,0,31,420,0,0,0,0,1,0,
616,0,0,30,0,0,30,433,0,0,0,0,1,0,
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* File name : Pcs_Snd_ZFJB1.pc *
* Module ID : *
* Module Name : *
* Purpose : Get ZFJB Data from ZFJBFile And Insert into DB *
* Author : Liu Yan Qiu ( DIMPT ) *
* Date Created : 1999,10,27 *
* Version : Version 1.0 *
* Environment : Digital UNIX *
* Portability : UNIX Platform *
* Warnings : *
* References1 : *
* Calling Syntax : *
* Parameters : None *
* Returns : void *
* Calling Function : *
* Called Functions : When system startup *
* Datastores and usages: *
* (a) Input *
* (b) OutPut *
* Report : None *
* Screens : None *
* Messages Files : None *
* Change Log : *
* Change No. Date Author Reason For Change *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
# include "/usr/bkfx/include/Pcs_Snd_ZFJB1/Pcs_Snd_ZFJB1.h"
void main( int argc, char *argv[])
{
signal( SIGTERM, Free_Mem);
/* EXEC SQL INCLUDE SQLCA;
*/
/*
* $Header: sqlca.h,v 1.3 1994/12/12 19:27:27 jbasu Exp $ sqlca.h
*/
/* Copyright (c) 1985,1986 by Oracle Corporation. */
/*
NAME
SQLCA : SQL Communications Area.
FUNCTION
Contains no code. Oracle fills in the SQLCA with status info
during the execution of a SQL stmt.
NOTES
**************************************************************
*** ***
*** This file is SOSD. Porters must change the data types ***
*** appropriately on their platform. See notes/pcport.doc ***
*** for more information. ***
*** ***
**************************************************************
If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA
will be defined to have this storage class. For example:
#define SQLCA_STORAGE_CLASS extern
will define the SQLCA as an extern.
If the symbol SQLCA_INIT is defined, then the SQLCA will be
statically initialized. Although this is not necessary in order
to use the SQLCA, it is a good pgming practice not to have
unitialized variables. However, some C compilers/OS's don't
allow automatic variables to be init'd in this manner. Therefore,
if you are INCLUDE'ing the SQLCA in a place where it would be
an automatic AND your C compiler/OS doesn't allow this style
of initialization, then SQLCA_INIT should be left undefined --
all others can define SQLCA_INIT if they wish.
If the symbol SQLCA_NONE is defined, then the SQLCA variable will
not be defined at all. The symbol SQLCA_NONE should not be defined
in source modules that have embedded SQL. However, source modules
that have no embedded SQL, but need to manipulate a sqlca struct
passed in as a parameter, can set the SQLCA_NONE symbol to avoid
creation of an extraneous sqlca variable.
MODIFIED
jbasu 12/12/94 - Bug 217878: note this is an SOSD file
losborne 08/11/92 - No sqlca var if SQLCA_NONE macro set
Clare 12/06/84 - Ch SQLCA to not be an extern.
Clare 10/21/85 - Add initialization.
Bradbury 01/05/86 - Only initialize when SQLCA_INIT set
Clare 06/12/86 - Add SQLCA_STORAGE_CLASS option.
*/
#ifndef SQLCA
#define SQLCA 1
struct sqlca
{
/* ub1 */ char sqlcaid[8];
/* b4 */ long sqlabc;
/* b4 */ long sqlcode;
struct
{
/* ub2 */ unsigned short sqlerrml;
/* ub1 */ char sqlerrmc[70];
} sqlerrm;
/* ub1 */ char sqlerrp[8];
/* b4 */ long sqlerrd[6];
/* ub1 */ char sqlwarn[8];
/* ub1 */ char sqlext[8];
};
#ifndef SQLCA_NONE
#ifdef SQLCA_STORAGE_CLASS
SQLCA_STORAGE_CLASS struct sqlca sqlca
#else
struct sqlca sqlca
#endif
#ifdef SQLCA_INIT
= {
{'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
sizeof(struct sqlca),
0,
{ 0, {0}},
{'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
}
#endif
;
#endif
#endif
/* end SQLCA */
/* */
/*
* $Header: sqlca.h,v 1.3 1994/12/12 19:27:27 jbasu Exp $ sqlca.h
*/
/* Copyright (c) 1985,1986 by Oracle Corporation. */
/*
NAME
SQLCA : SQL Communications Area.
FUNCTION
Contains no code. Oracle fills in the SQLCA with status info
during the execution of a SQL stmt.
NOTES
**************************************************************
*** ***
*** This file is SOSD. Porters must change the data types ***
*** appropriately on their platform. See notes/pcport.doc ***
*** for more information. ***
*** ***
**************************************************************
If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA
will be defined to have this storage class. For example:
#define SQLCA_STORAGE_CLASS extern
will define the SQLCA as an extern.
If the symbol SQLCA_INIT is defined, then the SQLCA will be
statically initialized. Although this is not necessary in order
to use the SQLCA, it is a good pgming practice not to have
unitialized variables. However, some C compilers/OS's don't
allow automatic variables to be init'd in this manner. Therefore,
if you are INCLUDE'ing the SQLCA in a place where it would be
an automatic AND your C compiler/OS doesn't allow this style
of initialization, then SQLCA_INIT should be left undefined --
all others can define SQLCA_INIT if they wish.
If the symbol SQLCA_NONE is defined, then the SQLCA variable will
not be defined at all. The symbol SQLCA_NONE should not be defined
in source modules that have embedded SQL. However, source modules
that have no embedded SQL, but need to manipulate a sqlca struct
passed in as a parameter, can set the SQLCA_NONE symbol to avoid
creation of an extraneous sqlca variable.
MODIFIED
jbasu 12/12/94 - Bug 217878: note this is an SOSD file
losborne 08/11/92 - No sqlca var if SQLCA_NONE macro set
Clare 12/06/84 - Ch SQLCA to not be an extern.
Clare 10/21/85 - Add initialization.
Bradbury 01/05/86 - Only initialize when SQLCA_INIT set
Clare 06/12/86 - Add SQLCA_STORAGE_CLASS option.
*/
#ifndef SQLCA
#define SQLCA 1
struct sqlca
{
/* ub1 */ char sqlcaid[8];
/* b4 */ long sqlabc;
/* b4 */ long sqlcode;
struct
{
/* ub2 */ unsigned short sqlerrml;
/* ub1 */ char sqlerrmc[70];
} sqlerrm;
/* ub1 */ char sqlerrp[8];
/* b4 */ long sqlerrd[6];
/* ub1 */ char sqlwarn[8];
/* ub1 */ char sqlext[8];
};
#ifndef SQLCA_NONE
#ifdef SQLCA_STORAGE_CLASS
SQLCA_STORAGE_CLASS struct sqlca sqlca
#else
struct sqlca sqlca
#endif
#ifdef SQLCA_INIT
= {
{'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
sizeof(struct sqlca),
0,
{ 0, {0}},
{'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
}
#endif
;
#endif
#endif
/* end SQLCA */
ProcessError(LOG_NORMAL, "Pcs_Snd_ZFJB1.x Is Begin!",END);
rtn_code = InitSndZFJB1();
if ( rtn_code < 0 )
{
ProcessError(LOG_ERROR,"Pcs_Snd_ZFJB1.x: Calling Function \
InitSndZFJB1() Failed!",END);
exit(0);
}
rtn_code = PCSSndZFJB1(argv[1],argv[2]);
if ( rtn_code < 0 )
{
ProcessError(LOG_ERROR,"Pcs_Snd_ZFJB1.x: Calling Function \
PCSSndZFJB1() Failed!",END);
exit(0);
}
rtn_code = EndPCSSndZFJB1(argv[1]);
if ( rtn_code < 0 )
{
ProcessError(LOG_ERROR,"Pcs_Snd_ZFJB1.x: Calling Function \
EndPCSSndZFJB1() Failed!",END);
exit(0);
}
} /* end of main program */
void Free_Mem()
{
ProcessError(LOG_NORMAL, "Pcs_Snd_ZFJB1.x Is Terminated By User!",END);
if ( tmp != NULL ) free( tmp );
fclose(fp);
/* EXEC SQL ROLLBACK RELEASE; */
{
struct sqlexd sqlstm;
sqlstm.sqlvsn = 8;
sqlstm.arrsiz = 0;
sqlstm.iters = (unsigned int )1;
sqlstm.offset = (unsigned int )2;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)0;
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}
exit(0);
}
int PCSSndZFJB1(char * zfj_fp, char * pc)
{
rtn_code = ReadZFJFileData( zfj_fp );
if ( rtn_code < 0 )
{
ProcessError(LOG_ERROR,"Pcs_Snd_ZFJB1.x: Calling Function \
ReadZFJFileData() Failed!",END);
if ( buf_zfjb != NULL ) free( buf_zfjb);
fclose(fp);
return(-1);
}
rtn_code = CreateSndLogAndHZRec(pc);
if ( rtn_code < 0 )
{
ProcessError(LOG_ERROR,"Pcs_Snd_ZFJB1.x: Calling Function \
CreateSndLogAndHZRec() Failed!",END);
if ( buf_zfjb != NULL ) free( buf_zfjb);
return(-1);
}
rtn_code = InsertZFJDBRec();
if ( rtn_code < 0 )
{
ProcessError(LOG_ERROR,"Pcs_Snd_ZFJB1.x: Calling Function \
InsertZFJDBRec() Failed!",END);
if ( buf_zfjb != NULL ) free( buf_zfjb);
return(-1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -