Expand|Select|Wrap|Line Numbers
- * Function: Generate_TO_Report(char* startDate, -- Beginning of date range
- * char* endDate, -- End of date range
- * struct parameters*) -- Structure holding configurable parameters
- *
- * Purpose: Get the 'Track Out' data for WaferSleuth from HDB.
- * 1. Fetch lot track-out list at first;
- * 2. Loop: get detail track-out information lot by lot
- * 3. Loop: write track-out information to data file
- * lot by lot.
- *
- *
- ************************************************************/
- int Generate_TO_Report(char* startDate,
- char* endDate,
- struct parameters* parms)
- {
- /***************************************************
- * Preparation
- ***************************************************/
- /* Variable declaration */
- int numOfFiles = 0;
- vc2_WipStepSK wipStep_SK;
- vc2_LotId lotId;
- vc2_StepId stepId;
- vc2_Device device;
- vc2_WaferQty qtyIn;
- vc2_WaferQty qtyOut;
- vc2_EqpId eqpId;
- vc2_Technology tech;
- vc2_DateTime toTime;
- vc2_DateTime txnTime;
- vc2_Stage stage;
- vc2_UserId userId;
- vc2_GroupHistKey groupHistKey;
- char currDateTime[20];
- /* Reset memory */
- memset(currDateTime, 0, sizeof(currDateTime));
- #ifdef DEBUG
- printf("%s: Start to retrieve Track-Out Information\n", GetCurrDateTime(currDateTime));
- #endif
- /***************************************************
- * Query data
- ***************************************************/
- /* Get Track Out lot list */
- EXEC SQL DECLARE wsToCursor CURSOR FOR
- SELECT wipstep_sk, trackouttime
- FROM hdbxuser.fwhdbwipstephistory@hdbsil
- WHERE trackouttime BETWEEN :startDate AND :endDate
- AND stepid NOT LIKE '%SorterAction%';
- /* Open cursor */
- EXEC SQL OPEN wsToCursor;
- /* Loop, fetching all salesperson's statistics.
- * Cause the program to break the loop when no more
- * data can be retrieved on the cursor.
- */
- EXEC SQL WHENEVER NOT FOUND DO break;
- for( ; ;)
- {
- /* Reset memory */
- memset(wipStep_SK, NULL, sizeof(wipStep_SK));
- memset(lotId, NULL, sizeof(lotId));
- memset(stepId, NULL, sizeof(stepId));
- memset(device, NULL, sizeof(device));
- memset(qtyIn, NULL, sizeof(qtyIn));
- memset(qtyOut, NULL, sizeof(qtyOut));
- memset(eqpId, NULL, sizeof(eqpId));
- memset(tech, NULL, sizeof(tech));
- memset(toTime, NULL, sizeof(toTime));
- memset(txnTime, NULL, sizeof(txnTime));
- memset(stage, NULL, sizeof(stage));
- memset(userId, NULL, sizeof(userId));
- memset(groupHistKey, NULL, sizeof(groupHistKey));
- /* Get WipStep_SK */
- EXEC SQL FETCH wsToCursor INTO :wipStep_SK, :toTime;
- /* Skip to next lot if no data found */
- EXEC SQL WHENEVER NOT FOUND GOTO NOTFOUND;
- /* Get detail lot information */
- EXEC SQL SELECT NVL (sh.lotid, 'NA') lotid, NVL (sh.stepid, 'NA') stepid,
- NVL (lotdevice.attrvalue, 'NA') device, NVL (w.lotqtyin, 99) lotqtyin,
- NVL (w.lotqtyout, 99) lotqtyout, NVL (sh.LOCATION, 'NA') eqpid,
- NVL (SUBSTR (sh.productname || '.',
- 1,
- INSTR (sh.productname || '.', '.', 1) - 1
- ),
- 'NA'
- ) tech,
- NVL (sh.trackouttime, 'NA') trackouttime, NVL (w.txntime,
- 'NA') txntime,
- NVL (lotstage.attrvalue, 'NA') stage, NVL (w.userid, 'NA') userid,
- NVL (w.grouphistkey, 'NA') grouphistkey
- INTO :lotId, :stepId, :device, :qtyIn, :qtyOut, :eqpId,
- :tech, :toTime, :txnTime, :stage, :userId, :groupHistKey
- FROM hdbxuser.fwhdbwiplotattrinstance@hdbsil lotstage,
- hdbxuser.fwhdbwiplotattrinstance@hdbsil lotdevice,
- hdbxuser.fwhdbwiptransaction@hdbsil w,
- hdbxuser.fwhdbwipstephistory@hdbsil sh
- WHERE sh.wipstep_sk = w.wipstep_sk
- AND w.activity = 'TrackOut'
- AND lotstage.lot_sk = w.lot_sk
- AND w.txn_sk BETWEEN lotstage.startsequence AND lotstage.stopsequence
- AND lotstage.attrname = 'Stage'
- AND lotstage.attrvalue != 'NONE'
- AND lotdevice.lot_sk = w.lot_sk
- AND lotdevice.attrname = 'partProgId'
- AND w.txn_sk BETWEEN lotdevice.startsequence AND lotdevice.stopsequence
- AND sh.wipstep_sk = :wipStep_SK
- AND w.txntime = :toTime;
- /* Write info into data file */
- if (strcmp (toTime,'11111111 00000000')==0)
- {
- Write_To_PT_File (startDate, endDate, lotId, stepId, device,
- qtyIn, qtyOut, eqpId, tech, toTime, stage, userId, parms);
- }
- else
- {
- Write_TO_DataFile(startDate, endDate, lotId, stepId, device,
- qtyIn, qtyOut, eqpId, tech, toTime, stage, userId, parms);
- }
- numOfFiles++;
- continue;
- NOTFOUND:
- ;
- }
- /* Close cursor */
- EXEC SQL CLOSE wsToCursor;
- #ifdef DEBUG
- printf(" %d 'TO' data files are written successfully\n", numOfFiles);
- printf("%s: Succeed to retrieve Track-Out Information\n", GetCurrDateTime(currDateTime));
- #endif
- return(numOfFiles);
- } /* Generate_TO_Report */
When i compile it i got im encounter this error
Expand|Select|Wrap|Line Numbers
- -I/home/oracle/product/806/precomp/public -
- DSLMXMX_ENABLE -DSLTS_ENABLE -c ExtractHDBDataForWaferSleuth_test.c
- ExtractHDBDataForWaferSleuth_test.c: In function `Generate_TO_Report':
- ExtractHDBDataForWaferSleuth_test.c:1332: character constant too long
- ExtractHDBDataForWaferSleuth_test.c:1332: warning: passing arg 2 of `strcmp' mak
- es pointer from integer without a cast
- *** Error code 1
- make: Fatal error: Command failed for target `ExtractHDBDataForWaferSleuth_test.
- o'