Re: LENGTH function and trailing spaces
Posted in 1995
Topics: Server Administration, Data Types & Schema Design
Nope .. that's another group. (and I sure wouldn't talk about it in this group ;-)) I can't figure out why I'm getting such a hard time about this question. We're building connectivity to Informix (that has already been announced) and of course the semantics of some SQL functions are different between the two systems. We will do the right thing (in terms of an Oracle users semantics) but I was just hitting a wall trying to figure out why length() was even in SQL. I can tell you why we have so many functions in our SQL if you want to e-mail me. And all the messages about not being ABLE to store trailing blanks make me wonder if VARCHAR is a relatively new feature -or- that users trim off blanks before they enter data (or make the forms products etc. do it) cause it sure looked like the server wasn't going to do it (hence the quote from the doc earlier) I do appreciate all the postive feedback. thanks again MikeT300 (miket300@aol.com) wrote: : Kirk Bradley - Mainframe and Integration Technologies : (kbradley@130.35.1.6) wrote: : : I now see what I was saying wrong. I kept saying CHAR and I meant : : VARCHAR. According to the Guide to SQL: Reference manual (pg 3-18 Data : types) : : : : "The database server does NOT strip a VARCHAR object of any : : user-entered trailing blanks, nor does the database server : : pad the VARCHAR to the full length of the column." : : ok.. so the question is: if I do this: : : CREATE TABLE KIRK (VC VARCHAR(100)) : : INSERT INTO KIRK VALUES ('KIRK AND 2 TRAILING BLANKS ') : : then how do I find out (in a SQL stmt (no 3-GL code)) that : : the length stored for that INSERT is 28 cause LENGTH(VC) : : will surely return 26 won't it? : Hey Kirk, : You wouldn't be working on that Informix to Oracle conversion tool project : I keep hearing about ??? : Just wondering. :-) : Mike Teachworth : CodeGen Software, Inc : 800-598-8649 : 504-456-1260 fax : work email: miket@codegen.com -- Kirk Bradley Oracle Corporation Mainframe and Integration Technologies Group