Help with ESQL/C and float data types
Posted in 1994
Howdy, We are encountering a possible conversion problem while using ESQL/C and an On-Line 5.01 data base while inserting values into table fields of type float. For example, we insert the value -11.71 into the table, but isql retrieves the value -12.38. Any clues as to what we are doing wrong? We are using doubles for the C variables. Here is the relevent code: The variable definitions: $short sParam1; $double dParam2; $double dParam3; $double dParam4; $double dParam5; $double dParam6; $double dParam7; $double dParam8; $double dParam9; The code that converts our null terminated strings that contain the floating point numbers into the esql variables: rstod(p1.avg, &dParam2); rstod(p1.dev, &dParam3); rstod(p1.ten_pc, &dParam4); rstod(p1.fifty_pc, &dParam5); rstod(p2.ninety_pc, &dParam6); rstod(p2.high, &dParam7); rstod(p2.low, &dParam8); rstod(p2.mode, &dParam9); The insert statement: $INSERT INTO results_table values ( $iPointerRT, $sParam1, $dParam2, $dParam3, $dParam4, $dParam5, $dParam6, $dParam7, $dParam8, $dParam9); Any help would be appreciated. Thanks, Bill bills@hpoemg.sj.hp.com