Re: Auto Truncate of Spaces
Posted in 2000
Topics: Connectivity: ODBC / JDBC / .NET
In may case, it is because I am using RogueWave DBTools as an access library for Informix. With DBTools 3.2, trailing spaces were auto-truncated. With DBTools 4.0.1, this behavior changed. I am trying to restore prior behavior so that my application will not break. This issue is apparently not a DBTools issue since they were just making use of native facilities available from Informix. >>>>> "WR" == William Rice <ricew@operamail.com> writes: WR> This seems to be a somewhat common desire which I have yet to really WR> understand. Is it just because it makes the code look neater, or is WR> there some other issue I am missing? WR> Will >> ===== Original Message From Jake Colman <colman@ppllc.com> ===== Is >> there a way to arrange for CHAR data fetched from the database to be >> auto-truncated of any trailing spaces? I do NOT want to use the TRIM >> function for each column to be truncated. I am looking for a >> lower-level solution, perhaps using some ODBC parameter. >> >> Thanks! >> >> -- Jake Colman >> >> Principia Partners LLC Phone: (201) 946-0300 Harborside Financial >> Center Fax: (201) 946-0320 902 Plaza II Beeper: (800) 928-4640 Jersey >> City, NJ 07311 E-mail: colman@ppllc.com E-mail: jcolman@jnc.com web: >> http://www.ppllc.com >> >> microsoft: "where do you want to go today?" linux: "where do you want >> to go tomorrow?" BSD: "are you guys coming, or what?" WR> ------------------------------------------------------------ This WR> e-mail has been sent to you courtesy of OperaMail, as a free service WR> from Opera Software, makers of the award-winning Web Browser, WR> Opera. Visit us at http://www.opera.com/ or our portal at: WR> http://www.myopera.com/ Your free e-mail account is waiting at: WR> http://www.operamail.com/ WR> ------------------------------------------------------------ -- Jake Colman Principia Partners LLC Phone: (201) 946-0300 Harborside Financial Center Fax: (201) 946-0320 902 Plaza II Beeper: (800) 928-4640 Jersey City, NJ 07311 E-mail: colman@ppllc.com E-mail: jcolman@jnc.com web: http://www.ppllc.com microsoft: "where do you want to go today?" linux: "where do you want to go tomorrow?" BSD: "are you guys coming, or what?"
Jake Colman wrote: > In may case, it is because I am using RogueWave DBTools as an access library > for Informix. With DBTools 3.2, trailing spaces were auto-truncated. With > DBTools 4.0.1, this behavior changed. I am trying to restore prior behavior > so that my application will not break. Just go into the DBTools source and change the types of host variables and of the sqlda or DESCRIPTOR variable binding types for chars in dynamic bindings from CCHARTYPE or SQLCHAR to CSTRINGTYPE which tells the engine to automatically strip trailing spaces and NULL terminate the column. Looks like Rogue Wave changed the way they do this in DBTools between V3.2 and 4.0.1 somewhere. THIS IS NOT A CHANGE in Informix behavior. Art S. Kagel > > > This issue is apparently not a DBTools issue since they were just making use > of native facilities available from Informix. > > >>>>> "WR" == William Rice <ricew@operamail.com> writes: > > WR> This seems to be a somewhat common desire which I have yet to really > WR> understand. Is it just because it makes the code look neater, or is > WR> there some other issue I am missing? > > WR> Will > >> ===== Original Message From Jake Colman <colman@ppllc.com> ===== Is > >> there a way to arrange for CHAR data fetched from the database to be > >> auto-truncated of any trailing spaces? I do NOT want to use the TRIM > >> function for each column to be truncated. I am looking for a > >> lower-level solution, perhaps using some ODBC parameter. > >> > >> Thanks! > >> > >> -- Jake Colman > >> > >> Principia Partners LLC Phone: (201) 946-0300 Harborside Financial > >> Center Fax: (201) 946-0320 902 Plaza II Beeper: (800) 928-4640 Jersey > >> City, NJ 07311 E-mail: colman@ppllc.com E-mail: jcolman@jnc.com web: > >> http://www.ppllc.com > >> > >> microsoft: "where do you want to go today?" linux: "where do you want > >> to go tomorrow?" BSD: "are you guys coming, or what?" > > WR> ------------------------------------------------------------ This > WR> e-mail has been sent to you courtesy of OperaMail, as a free service > WR> from Opera Software, makers of the award-winning Web Browser, > WR> Opera. Visit us at http://www.opera.com/ or our portal at: > WR> http://www.myopera.com/ Your free e-mail account is waiting at: > WR> http://www.operamail.com/ > WR> ------------------------------------------------------------ > > -- > Jake Colman > > Principia Partners LLC Phone: (201) 946-0300 > Harborside Financial Center Fax: (201) 946-0320 > 902 Plaza II Beeper: (800) 928-4640 > Jersey City, NJ 07311 E-mail: colman@ppllc.com > E-mail: jcolman@jnc.com > web: http://www.ppllc.com > > microsoft: "where do you want to go today?" > linux: "where do you want to go tomorrow?" > BSD: "are you guys coming, or what?"
>>>>> "ASK" == Art S Kagel <kagel@bloomberg.net> writes: ASK> Jake Colman wrote: >> In may case, it is because I am using RogueWave DBTools as an access >> library for Informix. With DBTools 3.2, trailing spaces were >> auto-truncated. With DBTools 4.0.1, this behavior changed. I am >> trying to restore prior behavior so that my application will not >> break. ASK> Just go into the DBTools source and change the types of host ASK> variables and of the ASK> sqlda or DESCRIPTOR variable binding types for chars in dynamic ASK> bindings from CCHARTYPE or SQLCHAR to CSTRINGTYPE which tells the ASK> engine to automatically strip trailing spaces and NULL terminate the ASK> column. Looks like Rogue Wave changed the way they do this in ASK> DBTools between V3.2 and 4.0.1 somewhere. THIS IS NOT A CHANGE in ASK> Informix behavior. Understood. But, it may be a change that hits you when you switch from ESQL to the Informix ODBC driver. That's what RW did when the released the new version of their library and that's when the behavior changed. -- Jake Colman Principia Partners LLC Phone: (201) 946-0300 Harborside Financial Center Fax: (201) 946-0320 902 Plaza II Beeper: (800) 928-4640 Jersey City, NJ 07311 E-mail: colman@ppllc.com E-mail: jcolman@jnc.com web: http://www.ppllc.com microsoft: "where do you want to go today?" linux: "where do you want to go tomorrow?" BSD: "are you guys coming, or what?"