Re: LENGTH function and trailing spaces
Posted in 1995
Topics: Data Types & Schema Design
Sorry.. what if the varchar column is the maximum length already. Concatenating another character to it will not work. I need a general solution. thanks Zdeno Miklas (ash@softec.sk) wrote: : Kirk Bradley - Mainframe and Integration Technologies (kbradley@130.35.1.6) wrote: : : I DONT'T want 'Kirk' and 'Kirk ' to return 7. And I don't : : want 'Kirk' and 'Kirk ' to return a length of 4 (although : : I understand that the current LENGTH() function will return : : 4 in each case. I want to find out the length of the string : : as stored by the application program. The pubs so I CAN STORE : : TRAILING blanks in the database for VARCHAR. The question is (still) : : how can I get the length as stored by the application program : : via a SQL statement. The answer appears to be that you cannot : : and that's fine with me. I just wanted to make sure I understood : : how things worked. Like someone said, if I can't ask that : : question of the database, then I won't. : I mean answer to your question was posted in this : thread. This statement returns length of varchar column : including trailing spaces. : : SELECT LENGTH(varcharcol || "x") - 1 FROM yourtable : IT works for me. : -- : Zdeno Miklas e-mail: ash@softec.sk : SOFTEC spol. s r. o. phone : 42-7-273805 ext.128 : Kutuzovova 23 fax : 42-7-272537 : 831 03 Bratislava SLOVAKIA -- Kirk Bradley Oracle Corporation Mainframe and Integration Technologies Group