Home » RDBMS Server » Server Administration » Re: To remove blanks within a field
Re: To remove blanks within a field [message #373006] Wed, 21 March 2001 23:52 Go to next message
Priya Rajkumar
Messages: 5
Registered: March 2001
Junior Member
Try using some editors to remove the spaces or try using awk commands if you are using unix to remove the spaces. Last option is to use replace command to remove all the spaces in the field after uploading. Example,

SQL> desc users;
Name Null? Type
------------------------------- -------- ----
USERNAME VARCHAR2(30)
NAME VARCHAR2(30)

13:37:50 SQL> insert into users values('s a r a d a p r i y a', 'sp');

1 row created.

real: 0
13:37:59 SQL> commit;

Commit complete.

real: 16
13:38:02 SQL> select * from users;

USERNAME NAME
------------------------------ ------------------------------
SARADA SARADA
s a r a d a p r i y a sp

real: 31
13:38:07 SQL> select replace(username, ' ', '') "username", name from users;

username NAME
------------------------------ ------------------------------
SARADA SARADA
saradapriya sp

HTH
Priya Rajkumar
Re: To remove blanks within a field [message #373011 is a reply to message #373006] Thu, 22 March 2001 08:26 Go to previous message
mala
Messages: 18
Registered: March 2001
Junior Member
Thanks Priya.The replace command worked.
Previous Topic: Re: converting Access query to SQL (for oracle)
Next Topic: Can we play with strings?
Goto Forum:
  


Current Time: Wed Jun 26 06:45:03 CDT 2024