hugonr
Posts: 17
|
| Posted: 05/11/2005, 11:48 AM |
|
when i open one record, everytime i get spaces in the end of the record...
i mean, if i have in my table one field "name" with size 20, if i have one record "john", and i open it, i will receive "johnXXXXXXXXXXXXXXXX" (every X represents one space), so, if i will edit it, i need to manually delete the spaces and only then i can edit it.
i found this post: http://forums.codecharge.com/posts.php?post_id=55493&s_keyword=trim+space
that i think is the way to solve this problem, but maybe i have any configuration in codecharge to solve this... can anyone help me?
cheers
|
 |
 |
DonB
|
| Posted: 05/11/2005, 6:30 PM |
|
Define the column as VARCHAR(20). It's a fixed size the way you have it and
therefore the DBMS pads out with blanks. VARCHAR won't do that.
--
DonB
http://www.gotodon.com/ccbth
"hugonr" <hugonr@forum.codecharge> wrote in message
news:54282536f0ea54@news.codecharge.com...
> when i open one record, everytime i get spaces in the end of the record...
>
> i mean, if i have in my table one field "name" with size 20, if i have one
> record "john", and i open it, i will receive "johnXXXXXXXXXXXXXXXX" (every
X
> represents one space), so, if i will edit it, i need to manually delete
the
> spaces and only then i can edit it.
>
> i found this post:
> http://forums.codecharge.com/posts.php?post_id=55493&s_keyword=trim+space
>
> that i think is the way to solve this problem, but maybe i have any
> configuration in codecharge to solve this... can anyone help me?
>
> cheers
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
hugonr
Posts: 17
|
| Posted: 05/12/2005, 6:44 AM |
|
you mean change all my fields types from "char" to "varchar", because that i cant do, i mean, the database is created and i dont have the rights to change it...
or you mean to change it in the edit objects properties in the record (in codecharge)?
if is the first option, dont have any other way?
cheers and thanks
|
 |
 |
DonB
|
| Posted: 05/17/2005, 6:15 AM |
|
Well. the first way is the 'right' way, represent the data in the manner you
need to use it. Otherwise, the only option I see is to fill the application
with lots of "trim" functions to strip away the blanks. That can be an
enormous amount of work as you would need to put in BeforeShow events on
everything that displays these values and thus the application will become
bloated and considerably harder to maintain.
Yes, I was referring to ALTERing the database table definitions from CHAR to
VARCHAR.
--
DonB
http://www.gotodon.com/ccbth
"hugonr" <hugonr@forum.codecharge> wrote in message
news:542835dd2c827d@news.codecharge.com...
> you mean change all my fields types from "char" to "varchar", because that
i
> cant do, i mean, the database is created and i dont have the rights to
change
> it...
>
> or you mean to change it in the edit objects properties in the record (in
> codecharge)?
>
> if is the first option, dont have any other way?
>
> cheers and thanks
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
hugonr
Posts: 17
|
| Posted: 05/17/2005, 11:34 AM |
|
i did that, thanks (change in the database char to varchar in all the fields)...
less work, and i told everyone here about that, so, no one will make it with char again
really thanks
|
 |
 |
|