Prob: sqlda and SQLDATE and rfmtdate
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, I have a problem converting an SQLDATE value from an sqlda-structure into a date value. The following works perfectly in 5.x Engines, but not in 4.x Engines (when linked with 5.x ESQL/C Libraries). ... char *dateformat="dd.mm.yyy"; ... switch(col->sqltype) { case SQLDATE: rfmtdate(*((long*)col->sqldata),dateformat,buf); break; case SQLSMFLOAT: ... I know about the trick to define col->sqltype as CCHARTYPE before fetching, then I would retrieve a string, but I might need the real sqltype later in my program. My problem is: I wrote an Interpreter that has to run on 4.x and on 5.x and I don't want to have 2 binaries linked with different libraries. And there are memory leaks in 4.x libraries that have been fixed in 5.x. The results I get with 4.x do make sense, I get numbers like 11213, 11214 and so on in my "buf". Maybe I could make a date-string from the numbers somehow. Any ideas ? Thanks Christoph -- Origin: It's not a bug, it's a feature !