13.07.2015 Views

IBM Flex System x240 w

IBM Flex System x240 w

IBM Flex System x240 w

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

exit(-1);}if (option == 9 && (outtype2 == 0 || outname2 == NULL || strcmp(outname2,"") == 0)){fprintf(stderr,"gendata: Invalid 2nd output file/pipe specified.\n");exit(-1);}/* Ensure O/OL flat files are opened in append mode. This is required *//* because we generate O/OL concurrently. See comments in genload.pl *//* for further details on why this is neccessary. */if (option == 9){if (outtype1 == IOH_FILE) outtype1 = IOH_FILE_APPEND;if (outtype2 == IOH_FILE) outtype2 = IOH_FILE_APPEND;}/* Validate Range Arguments */if (ware_start WAREHOUSES) {fprintf(stderr,"gendata: Invalid range starting value: %d\n",ware_start);exit(-1);}if (ware_end WAREHOUSES || ware_end < ware_start) {fprintf(stderr,"gendata: Invalid range ending value: %d\n",ware_end);exit(-1);}initialize_random();}/* ***************************************************************** *//* Generate Data *//* ***************************************************************** */switch (option) {case 3: /* WAREHOUSE */gen_ware_tbl();break;case 4: /* DISTRICT */gen_dist_tbl();break;case 5: /* ITEM */gen_item_tbl();break;case 6: /* STOCK */gen_stock_tbl();break;case 7: /* CUSTOMER */gen_cust_tbl();break;case 8: /* HISTORY */gen_hist_tbl();break;case 9: /* ORDERS + ORDER_LINE */gen_ordr_tbl();break;case 11: /* NEW_ORDER */gen_nu_ord_tbl();break;case 2:case 10:default:fprintf(stderr, "Error: invalid option = %d \n",(option));break;}return 0;/*----------------------------------------------------------------------*//* generate item table *//*----------------------------------------------------------------------*/void gen_item_tbl( void ){sqlint32 item_num = 0 ;sqlint32 item_im_id ;char item_name[25] ;double item_price ;char item_data[51] ;IOH_NUM numBytes;ioHandle hnd;char Buffer[1024];timestamp1 = current_time();rc = GenericOpen(&hnd, outtype1, outname1);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!