Xref: utzoo comp.os.vms:38734 comp.databases:10049 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!hagbard!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.os.vms,comp.databases Subject: Word on warning on SQL/C and RDB 4.0 Message-ID: <3380@enea.se> Date: 13 May 91 21:21:28 GMT Followup-To: comp.os.vms Organization: Enea Data AB, Sweden Lines: 23 If you have an SQL/C program with something like char x ... EXEC SQL INSERT INTO Some_table (x) USING :x; /* Damn it, what was the syntax now? */ and where the column Some_table.x is declared as char every- thing will work fine until you recompile under RDB 4.0. With the additions of TINYINT to SQL takes char as a byte integer and converts it to a string which it then truncates. So if the C variable x has the value 'A', Some_table.x will get the value '6'. This has bitten us twice now. The workaround is simple. Change the C declaration to x[2] and handle a thereafter. This implcit conversion from/to strings to/from binary types that SQL$PRE does is disgusting. I want an RDML-like preprocessor which gives a damn in my host language code. -- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se WORLD CHAMPIONS IN ICE HOCKEY 1991 - S W E D E N!