/* 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; /* Object support */ struct sqltvn { unsigned char *tvnvsn; unsigned short tvnvsnl; unsigned char *tvnnm; unsigned short tvnnml; unsigned char *tvnsnm; unsigned short tvnsnml; }; typedef struct sqltvn sqltvn; struct sqladts { unsigned int adtvsn; unsigned short adtmode; unsigned short adtnum; sqltvn adttvn[1]; }; typedef struct sqladts sqladts; static struct sqladts sqladt = { 1,1,0, }; /* Binding to PL/SQL Records */ struct sqltdss { unsigned int tdsvsn; unsigned short tdsnum; unsigned char *tdsval[1]; }; typedef struct sqltdss sqltdss; static struct sqltdss sqltds = { 1, 0, }; /* File name & Package Name */ struct sqlcxp { unsigned short fillen; char filnam[19]; }; static struct sqlcxp sqlfpn = { 18, "Populate_Filter.pc" }; static unsigned long sqlctx = 20894331; 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; sqladts *sqladtp; sqltdss *sqltdsp; void **sqphsv; unsigned int *sqphsl; int *sqphss; void **sqpind; int *sqpins; unsigned int *sqparm; unsigned int **sqparc; unsigned short *sqpadto; unsigned short *sqptdso; void *sqhstv[7]; unsigned int sqhstl[7]; int sqhsts[7]; void *sqindv[7]; int sqinds[7]; unsigned int sqharm[7]; unsigned int *sqharc[7]; unsigned short sqadto[7]; unsigned short sqtdso[7]; } sqlstm = {10,7}; /* SQLLIB 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 * _*/); 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[] = {10,4130,0,0,0, 5,0,0,1,0,0,27,120,0,0,4,4,0,1,0,1,97,0,0,1,10,0,0,1,10,0,0,1,10,0,0, 36,0,0,2,132,0,3,141,0,0,2,2,0,1,0,1,97,0,0,1,3,0,0, 59,0,0,3,51,0,4,160,0,0,1,0,0,1,0,2,3,0,0, 78,0,0,4,43,0,4,164,0,0,1,0,0,1,0,2,3,0,0, 97,0,0,5,67,0,3,166,0,0,1,1,0,1,0,1,3,0,0, 116,0,0,6,114,0,3,194,0,0,1,1,0,1,0,1,3,0,0, 135,0,0,7,191,0,3,197,0,0,7,7,0,1,0,1,4,0,0,1,4,0,0,1,4,0,0,1,4,0,0,1,3,0,0,1, 4,0,0,1,4,0,0, 178,0,0,8,54,0,4,211,0,0,2,1,0,1,0,2,3,0,0,1,97,0,0, 201,0,0,9,160,0,3,222,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0, 228,0,0,10,102,0,3,225,0,0,3,3,0,1,0,1,97,0,0,1,1,0,0,1,4,0,0, 255,0,0,11,0,0,32,238,0,0,0,0,0,1,0, 270,0,0,12,110,0,3,258,0,0,2,2,0,1,0,1,3,0,0,1,4,0,0, 293,0,0,13,148,0,3,272,0,0,4,4,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0,1,3,0,0, 324,0,0,14,159,0,3,286,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0, 351,0,0,15,132,0,3,289,0,0,4,4,0,1,0,1,97,0,0,1,3,0,0,1,4,0,0,1,4,0,0, 382,0,0,16,159,0,3,302,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0, 409,0,0,17,132,0,3,305,0,0,4,4,0,1,0,1,97,0,0,1,3,0,0,1,4,0,0,1,4,0,0, 440,0,0,18,159,0,3,319,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0, 467,0,0,19,141,0,3,325,0,0,3,3,0,1,0,1,3,0,0,1,4,0,0,1,4,0,0, 494,0,0,20,159,0,3,339,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0, 521,0,0,21,141,0,3,345,0,0,3,3,0,1,0,1,3,0,0,1,4,0,0,1,4,0,0, 548,0,0,22,159,0,3,357,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,3,0,0, 575,0,0,23,143,0,3,360,0,0,5,5,0,1,0,1,97,0,0,1,4,0,0,1,4,0,0,1,4,0,0,1,3,0,0, 610,0,0,24,86,0,3,373,0,0,2,2,0,1,0,1,3,0,0,1,4,0,0, 633,0,0,25,46,0,4,390,0,0,1,0,0,1,0,2,3,0,0, 652,0,0,26,70,0,5,392,0,0,3,3,0,1,0,1,4,0,0,1,4,0,0,1,3,0,0, 679,0,0,27,0,0,30,414,0,0,0,0,0,1,0, }; /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ /* Populate_Filter.pc */ /* Load to the NCEDC database the filter info. */ /* Errors can be found on Error.log */ /* */ /* Zuzlewski Stephane @1998 */ /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ #include #include #include /* EXEC SQL INCLUDE sqlca.h; */ /* * $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 */ typedef char asciz[20]; typedef char vc2_arr[11]; /* EXEC SQL BEGIN DECLARE SECTION; */ /* User-defined type for null-terminated strings */ /* EXEC SQL TYPE asciz IS STRING(20) REFERENCE; */ /* User-defined type for a VARCHAR array element */ /* EXEC SQL TYPE vc2_arr IS VARCHAR2(11) REFERENCE; */ asciz username; asciz password; char user_pwd[80]; int i; int j; int k; int idtmp; char sfid[32]; /* Sequence of filters identification */ int nb_stage; /* Number of stages */ float sgain; /* Sequence of filters gain */ float sfreq; /* Sequence of filters frequency */ float gain; /* Filter gain */ float freq; /* Filter frequency */ float insamp; /* Input sample rate */ float outsamp; /* Output sample rate */ int offset; /* Decimation offset */ float delay; /* Estimated delay */ float correction; /* Correction applied */ int nb_line; /* Number of response lines */ char ftype[32]; /* Filter type */ int nb_pole; /* Number of poles */ float corner; /* Corner frequency */ float damping; /* Damping value */ float r_value; /* Real part of a complex pole/zero */ float i_value; /* Imaginary part of a complex pole/zero */ int Flag_PZ; /* Flag for poles & zeros */ char ptype[32]; /* Polynomial type */ float lower; /* Polynomial lower bound */ float upper; /* Polynomial upper bound */ float maxerror; /* Maximum error of polynomial approximation */ int nb_coeff; /* Number of coefficients */ float pncoeff; /* Polynomial coefficients */ int respnb; /* Response number */ char firname[32]; /* FIR filter name */ float firgain; /* FIR filter gain */ int firid; /* FIR filter identifier */ char symmetry[5]; /* FIR filter symmetry */ char symm; /* FIR filter symmetry */ float coeff_value; /* FIR filter coefficients value */ int coeff_nb; /* FIR filter coefficients number */ int unitin; /* Input units */ int unitout; /* Output units */ /* EXEC SQL END DECLARE SECTION; */ long SQLCODE; FILE* f_err; /* Error File descriptor */ void sql_error(); /* handles unrecoverable errors */ /*-*-*-*-*-*-*-*-*/ /* Main function */ /*-*-*-*-*-*-*-*-*/ main (argc, argv) int argc; char* argv[]; { FILE* f_filter; /* Filter file descriptor */ char line[1025]; /* Line information */ char header[7]; /* Header */ float pn_coeff[21]; /* Polynomial coefficients */ /* Opening the error file */ if ((f_err = fopen ("Error.log", "w+t")) == NULL) { printf ("\n Error [File (Error.log) could not be opened].\n\n"); exit (0); } /* Opening the filter file */ if ((f_filter = fopen ("filter.tbl", "rt")) == NULL) { printf ("\n Error [File (filter.tbl) could not be opened].\n\n"); exit (0); } /* Connect to ORACLE. */ /* EXEC SQL WHENEVER SQLERROR DO sql_error(); */ strcpy (username, "ncedcdba"); strcpy (password, "passwd"); strcpy (user_pwd, "ncedcdba/passwd@ncedc"); /* EXEC SQL CONNECT :user_pwd; */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 4; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.iters = (unsigned int )10; sqlstm.offset = (unsigned int )5; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)user_pwd; sqlstm.sqhstl[0] = (unsigned int )80; sqlstm.sqhsts[0] = ( int )80; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n Connected to ORACLE as user: %s\n", username); /* Parsing filter file */ fgets (line, 1024, f_filter); while (!feof (f_filter)) { strcpy (header, ""); sscanf (line, "%s", header); if (!strcmp (header, "FIRFS")) { /* Reading filters chain information */ sscanf (line, "%*s %s %d", sfid, &nb_stage); printf ("\n Filter chain : %s\t%d", sfid, nb_stage); /* Inserting filter chain information into the database */ /* EXEC SQL INSERT INTO Filter_Sequence (seqfil_id, name, nb_filter, gain, frequency, lddate) VALUES (seqfilseq.NEXTVAL, :sfid, :nb_stage, NULL, NULL, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 4; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Filter_Sequence(seqfil_id,name,nb_filter,gain,\ frequency,lddate) values (seqfilseq.nextval ,:b0,:b1,null ,null ,sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )36; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)sfid; sqlstm.sqhstl[0] = (unsigned int )32; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&nb_stage; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } for (i=1;i<=nb_stage;i++) { Flag_PZ = 0; respnb = 0; fgets (line, 1024, f_filter); /* Reading filter information */ sscanf (line, "%*s %f %f %*s %*s %d", &gain, &freq, &nb_line); printf ("\n\t Filter : %f\t%f\t%d", gain, freq, nb_line); /* Searching units information */ unitin = 0; unitout = 0; /* EXEC SQL SELECT id INTO :unitout FROM D_Unit WHERE name = 'COUNTS'; */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 4; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "select id into :b0 from D_Unit where name='COUNTS'"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )59; sqlstm.selerr = (unsigned short)1; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&unitout; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } if (unitout == 0) { /* EXEC SQL SELECT uniseq.NEXTVAL INTO :unitout FROM DUAL; */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 4; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "select uniseq.nextval into :b0 from DUAL "; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )78; sqlstm.selerr = (unsigned short)1; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&unitout; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* EXEC SQL INSERT INTO D_Unit (id, name, description) VALUES (:unitout, 'COUNTS', NULL); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 4; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into D_Unit(id,name,description) values (:b0,'COU\ NTS',null )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )97; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&unitout; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } } unitin = unitout; for (j=1;j<=nb_line;j++) { fgets (line, 1024, f_filter); /* Reading response type */ strcpy (header, ""); sscanf (line, "%s", header); if (!strcmp (header, "INPUT")) { /* Reading input information */ sscanf (line, "%*s %f %*s %f %d", &insamp, &outsamp, &offset); printf ("\n\t\t Input : %f\t%f\t%d", insamp, outsamp, offset); } else if (!strcmp (header, "DELAY")) { /* Reading delay information */ sscanf (line, "%*s %f %f", &delay, &correction); printf ("\n\t\t Delay : %f\t%f", delay, correction); /* EXEC SQL INSERT INTO Filter_Sequence_Data (seqfil_id, filter_nb, filter_id) VALUES (seqfilseq.CURRVAL, :i, filterseq.NEXTVAL); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 4; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Filter_Sequence_Data(seqfil_id,filter_nb,fi\ lter_id) values (seqfilseq.currval ,:b0,filterseq.nextval )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )116; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&i; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* EXEC SQL INSERT INTO Filter (filter_id, gain, frequency, in_sp_rate, out_sp_rate, offset, delay, correction, seqresp_id, lddate) VALUES (filterseq.CURRVAL, :gain, :freq, :insamp, :outsamp, :offset, :delay, :correction, respseq.NEXTVAL, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Filter(filter_id,gain,frequency,in_sp_rate,\ out_sp_rate,offset,delay,correction,seqresp_id,lddate) values (filterseq.currv\ al ,:b0,:b1,:b2,:b3,:b4,:b5,:b6,respseq.nextval ,sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )135; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&gain; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&freq; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&insamp; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqhstv[3] = ( void *)&outsamp; sqlstm.sqhstl[3] = (unsigned int )4; sqlstm.sqhsts[3] = ( int )0; sqlstm.sqindv[3] = ( void *)0; sqlstm.sqinds[3] = ( int )0; sqlstm.sqharm[3] = (unsigned int )0; sqlstm.sqadto[3] = (unsigned short )0; sqlstm.sqtdso[3] = (unsigned short )0; sqlstm.sqhstv[4] = ( void *)&offset; sqlstm.sqhstl[4] = (unsigned int )4; sqlstm.sqhsts[4] = ( int )0; sqlstm.sqindv[4] = ( void *)0; sqlstm.sqinds[4] = ( int )0; sqlstm.sqharm[4] = (unsigned int )0; sqlstm.sqadto[4] = (unsigned short )0; sqlstm.sqtdso[4] = (unsigned short )0; sqlstm.sqhstv[5] = ( void *)&delay; sqlstm.sqhstl[5] = (unsigned int )4; sqlstm.sqhsts[5] = ( int )0; sqlstm.sqindv[5] = ( void *)0; sqlstm.sqinds[5] = ( int )0; sqlstm.sqharm[5] = (unsigned int )0; sqlstm.sqadto[5] = (unsigned short )0; sqlstm.sqtdso[5] = (unsigned short )0; sqlstm.sqhstv[6] = ( void *)&correction; sqlstm.sqhstl[6] = (unsigned int )4; sqlstm.sqhsts[6] = ( int )0; sqlstm.sqindv[6] = ( void *)0; sqlstm.sqinds[6] = ( int )0; sqlstm.sqharm[6] = (unsigned int )0; sqlstm.sqadto[6] = (unsigned short )0; sqlstm.sqtdso[6] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } } else if (!strcmp (header, "FIR")) { respnb++; /* Reading FIR filter information */ sscanf (line, "%*s %s %s %f", firname, symmetry, &firgain); symm = symmetry[0]; /* Inserting response information into the database */ firid = 0; /* EXEC SQL SELECT fir_id INTO firid FROM Filter_FIR WHERE name = :firname; */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "select fir_id into :b0 from Filter_FIR where name=:b1"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )178; sqlstm.selerr = (unsigned short)1; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&firid; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)firname; sqlstm.sqhstl[1] = (unsigned int )32; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } if (firid == 0) /* FIR filter not yet in database */ { FILE *f_coeff; /* FIR filter coefficients file descriptor */ char line_coeff[255]; /* Current line */ char head_coeff[32]; /* Header information */ char name_coeff[32]; /* FIR filter coefficients file name */ char name_coeff2[128]; /* FIR filter coefficients file name */ /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'F', firseq.NEXTVAL, :unitin, :unitout, 'D', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,res\ p_id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'F',firseq.n\ extval ,:b1,:b2,'D',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )201; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&unitin; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitout; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* EXEC SQL INSERT INTO Filter_FIR (fir_id, name, symmetry, gain, lddate) VALUES (firseq.CURRVAL, :firname, :symm, :firgain, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Filter_FIR(fir_id,name,symmetry,gain,ldda\ te) values (firseq.currval ,:b0,:b1,:b2,sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )228; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)firname; sqlstm.sqhstl[0] = (unsigned int )32; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&symm; sqlstm.sqhstl[1] = (unsigned int )1; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&firgain; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* Populating the database with the FIR coefficients */ strcpy (name_coeff, firname); name_coeff[3] = '_'; sprintf (name_coeff2, "/data/dc2/Interim/blockettes.new/include/%s.b41.src", name_coeff); /* Opening the filter file */ if ((f_coeff = fopen (name_coeff2, "rt")) == NULL) { printf ("\n Error [File (%s) could not be opened].\n\n", name_coeff2); /* EXEC SQL ROLLBACK WORK RELEASE; */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )255; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } exit (0); } /* Parsing FIR filter coefficients file */ fgets (line_coeff, 1024, f_coeff); coeff_nb = 0; while (!feof (f_coeff)) { strcpy (head_coeff, ""); sscanf (line_coeff, "%s", head_coeff); if (!strcmp (head_coeff, "fir_coeff:")) { coeff_nb++; sscanf (line_coeff, "%*s %f", &coeff_value); /* EXEC SQL INSERT INTO Filter_FIR_Data (fir_id, coeff_nb, type, coefficient, error) VALUES (firseq.CURRVAL, :coeff_nb, 'N', :coeff_value, NULL); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Filter_FIR_Data(fir_id,coeff_nb,type,coe\ fficient,error) values (firseq.currval ,:b0,'N',:b1,null )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )270; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&coeff_nb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&coeff_value; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n\t\t %d\t%f", coeff_nb, coeff_value); } fgets (line_coeff, 1024, f_coeff); } fclose (f_coeff); } else { /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'F', :firid, :unitin, :unitout, 'D', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,resp\ _id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'F',:b1,:b2,:\ b3,'D',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )293; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&firid; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitin; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqhstv[3] = ( void *)&unitout; sqlstm.sqhstl[3] = (unsigned int )4; sqlstm.sqhsts[3] = ( int )0; sqlstm.sqindv[3] = ( void *)0; sqlstm.sqinds[3] = ( int )0; sqlstm.sqharm[3] = (unsigned int )0; sqlstm.sqadto[3] = (unsigned short )0; sqlstm.sqtdso[3] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } } printf ("\n\t\t FIR filter : %s\t%s\t%f", firname, symmetry, firgain); } else if (!strcmp (header, "HP")) { respnb++; /* Reading high-pass filter information */ sscanf (line, "%*s %s %d %f %f", ftype, &nb_pole, &corner, &damping); /* Inserting response information into the database */ /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'H', hpseq.NEXTVAL, :unitin, :unitout, 'A', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,resp_\ id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'H',hpseq.next\ val ,:b1,:b2,'A',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )324; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&unitin; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitout; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* EXEC SQL INSERT INTO Response_HP (hp_id, filter_type, nb_pole, corner_freq, damping_value, lddate) VALUES (hpseq.CURRVAL, :ftype, :nb_pole, :corner, :damping, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response_HP(hp_id,filter_type,nb_pole,corne\ r_freq,damping_value,lddate) values (hpseq.currval ,:b0,:b1,:b2,:b3,sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )351; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)ftype; sqlstm.sqhstl[0] = (unsigned int )32; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&nb_pole; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&corner; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqhstv[3] = ( void *)&damping; sqlstm.sqhstl[3] = (unsigned int )4; sqlstm.sqhsts[3] = ( int )0; sqlstm.sqindv[3] = ( void *)0; sqlstm.sqinds[3] = ( int )0; sqlstm.sqharm[3] = (unsigned int )0; sqlstm.sqadto[3] = (unsigned short )0; sqlstm.sqtdso[3] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n\t\t HP : %s\t%d\t%f\t%f", ftype, nb_pole, corner, damping); } else if (!strcmp (header, "LP")) { respnb++; /* Reading low-pass filter information */ sscanf (line, "%*s %s %d %f %f", ftype, &nb_pole, &corner, &damping); /* Inserting response information into the database */ /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'L', lpseq.NEXTVAL, :unitin, :unitout, 'A', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,resp_\ id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'L',lpseq.next\ val ,:b1,:b2,'A',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )382; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&unitin; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitout; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* EXEC SQL INSERT INTO Response_LP (lp_id, filter_type, nb_pole, corner_freq, damping_value, lddate) VALUES (lpseq.CURRVAL, :ftype, :nb_pole, :corner, :damping, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response_LP(lp_id,filter_type,nb_pole,corne\ r_freq,damping_value,lddate) values (lpseq.currval ,:b0,:b1,:b2,:b3,sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )409; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)ftype; sqlstm.sqhstl[0] = (unsigned int )32; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&nb_pole; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&corner; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqhstv[3] = ( void *)&damping; sqlstm.sqhstl[3] = (unsigned int )4; sqlstm.sqhsts[3] = ( int )0; sqlstm.sqindv[3] = ( void *)0; sqlstm.sqinds[3] = ( int )0; sqlstm.sqharm[3] = (unsigned int )0; sqlstm.sqadto[3] = (unsigned short )0; sqlstm.sqtdso[3] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n\t\t LP : %s\t%d\t%f\t%f", ftype, nb_pole, corner, damping); } else if (!strcmp (header, "CP")) { /* Reading complex pole information */ sscanf (line, "%*s %f %f", &r_value, &i_value); if (Flag_PZ == 0) { respnb++; /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'Z', pzseq.NEXTVAL, :unitin, :unitout, 'A', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,res\ p_id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'Z',pzseq.ne\ xtval ,:b1,:b2,'A',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )440; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&unitin; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitout; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } } Flag_PZ++; /* EXEC SQL INSERT INTO Response_PZ (pz_id, pz_nb, type, r_value, r_error, i_value, i_error, lddate) VALUES (pzseq.CURRVAL, :Flag_PZ, 'P', :r_value, NULL, :i_value, NULL, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response_PZ(pz_id,pz_nb,type,r_value,r_erro\ r,i_value,i_error,lddate) values (pzseq.currval ,:b0,'P',:b1,null ,:b2,null ,s\ ysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )467; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&Flag_PZ; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&r_value; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&i_value; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n\t\t CP : %f\t%f", r_value, i_value); } else if (!strcmp (header, "CZ")) { /* Reading complex zero information */ sscanf (line, "%*s %f %f", &r_value, &i_value); if (Flag_PZ == 0) { respnb++; /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'Z', pzseq.NEXTVAL, :unitin, :unitout, 'A', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,res\ p_id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'Z',pzseq.ne\ xtval ,:b1,:b2,'A',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )494; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&unitin; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitout; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } } Flag_PZ++; /* EXEC SQL INSERT INTO Response_PZ (pz_id, pz_nb, type, r_value, r_error, i_value, i_error, lddate) VALUES (pzseq.CURRVAL, :Flag_PZ, 'Z', :r_value, NULL, :i_value, NULL, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response_PZ(pz_id,pz_nb,type,r_value,r_erro\ r,i_value,i_error,lddate) values (pzseq.currval ,:b0,'Z',:b1,null ,:b2,null ,s\ ysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )521; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&Flag_PZ; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&r_value; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&i_value; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n\t\t CZ : %f\t%f", r_value, i_value); } else if (!strcmp (header, "PN")) { respnb++; /* Reading polynomial information */ sscanf (line, "%*s %s %f %f %f %d", ptype, &lower, &upper, &maxerror, &nb_coeff); /* EXEC SQL INSERT INTO Response (seqresp_id, resp_nb, resp_type, resp_id, unit_in, unit_out, r_type, lddate) VALUES (respseq.CURRVAL, :respnb, 'P', pnseq.NEXTVAL, :unitin, :unitout, 'A', SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response(seqresp_id,resp_nb,resp_type,resp_\ id,unit_in,unit_out,r_type,lddate) values (respseq.currval ,:b0,'P',pnseq.next\ val ,:b1,:b2,'A',sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )548; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)&respnb; sqlstm.sqhstl[0] = (unsigned int )4; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&unitin; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&unitout; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } /* EXEC SQL INSERT INTO Response_PN (pn_id, poly_type, lower_bound, upper_bound, max_error, nb_coeff, lddate) VALUES (pnseq.CURRVAL, :ptype, :lower, :upper, :maxerror, :nb_coeff, SYSDATE); */ { struct sqlexd sqlstm; sqlstm.sqlvsn = 10; sqlstm.arrsiz = 7; sqlstm.sqladtp = &sqladt; sqlstm.sqltdsp = &sqltds; sqlstm.stmt = "insert into Response_PN(pn_id,poly_type,lower_bound,upp\ er_bound,max_error,nb_coeff,lddate) values (pnseq.currval ,:b0,:b1,:b2,:b3,:b4\ ,sysdate )"; sqlstm.iters = (unsigned int )1; sqlstm.offset = (unsigned int )575; sqlstm.cud = sqlcud0; sqlstm.sqlest = (unsigned char *)&sqlca; sqlstm.sqlety = (unsigned short)0; sqlstm.sqhstv[0] = ( void *)ptype; sqlstm.sqhstl[0] = (unsigned int )32; sqlstm.sqhsts[0] = ( int )0; sqlstm.sqindv[0] = ( void *)0; sqlstm.sqinds[0] = ( int )0; sqlstm.sqharm[0] = (unsigned int )0; sqlstm.sqadto[0] = (unsigned short )0; sqlstm.sqtdso[0] = (unsigned short )0; sqlstm.sqhstv[1] = ( void *)&lower; sqlstm.sqhstl[1] = (unsigned int )4; sqlstm.sqhsts[1] = ( int )0; sqlstm.sqindv[1] = ( void *)0; sqlstm.sqinds[1] = ( int )0; sqlstm.sqharm[1] = (unsigned int )0; sqlstm.sqadto[1] = (unsigned short )0; sqlstm.sqtdso[1] = (unsigned short )0; sqlstm.sqhstv[2] = ( void *)&upper; sqlstm.sqhstl[2] = (unsigned int )4; sqlstm.sqhsts[2] = ( int )0; sqlstm.sqindv[2] = ( void *)0; sqlstm.sqinds[2] = ( int )0; sqlstm.sqharm[2] = (unsigned int )0; sqlstm.sqadto[2] = (unsigned short )0; sqlstm.sqtdso[2] = (unsigned short )0; sqlstm.sqhstv[3] = ( void *)&maxerror; sqlstm.sqhstl[3] = (unsigned int )4; sqlstm.sqhsts[3] = ( int )0; sqlstm.sqindv[3] = ( void *)0; sqlstm.sqinds[3] = ( int )0; sqlstm.sqharm[3] = (unsigned int )0; sqlstm.sqadto[3] = (unsigned short )0; sqlstm.sqtdso[3] = (unsigned short )0; sqlstm.sqhstv[4] = ( void *)&nb_coeff; sqlstm.sqhstl[4] = (unsigned int )4; sqlstm.sqhsts[4] = ( int )0; sqlstm.sqindv[4] = ( void *)0; sqlstm.sqinds[4] = ( int )0; sqlstm.sqharm[4] = (unsigned int )0; sqlstm.sqadto[4] = (unsigned short )0; sqlstm.sqtdso[4] = (unsigned short )0; sqlstm.sqphsv = sqlstm.sqhstv; sqlstm.sqphsl = sqlstm.sqhstl; sqlstm.sqphss = sqlstm.sqhsts; sqlstm.sqpind = sqlstm.sqindv; sqlstm.sqpins = sqlstm.sqinds; sqlstm.sqparm = sqlstm.sqharm; sqlstm.sqparc = sqlstm.sqharc; sqlstm.sqpadto = sqlstm.sqadto; sqlstm.sqptdso = sqlstm.sqtdso; sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); SQLCODE = sqlca.sqlcode; if (sqlca.sqlcode < 0) sql_error(); } printf ("\n\t\t PN : %s\t%f\t%f\t%f\t%d", ptype, lower, upper, maxerror, nb_coeff); /* Reading polynomial coefficients */ sscanf (line, "%*s %*s %*s %*s %*s %*s %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f", &pn_coeff[0], &pn_coeff[1], &pn_coeff[2], &pn_coeff[3], &pn_coeff[4], &pn_coeff[5], &pn_coeff[6], &pn_coeff[7], &pn_coeff[8], &pn_coeff[9], &pn_coeff[10], &pn_coeff[11], &pn_coeff[12], &pn_coeff[13], &pn_coeff[14], &pn_coeff[15], &pn_coeff[16], &pn_coeff[17], &pn_coeff[18], &pn_coeff[19]); printf ("\n\t\t\t Coefficients : "); for (k=0;k