Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Manipulating string in a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
BAJJI

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Fri Nov 17, 2006 3:22 pm    Post subject: Manipulating string in a table
Reply with quote

hi,

In a table, one field is declared string, which contains more than one space between two words, eg,

ABC DEF FEGLH

the requirement is to remove all the spaces between the words and insert only a single space like this ....

ABC DEF FEGLH

I want a query or Stored Procedure, as its a table.........

In program we can do this by breaking the strings, but not getting how to do this in a query or Stored Proc

Please answer this ASAP

thanks,
Kiran.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri Nov 17, 2006 5:13 pm    Post subject: Re: Manipulating string in a table
Reply with quote

there is no difference between
Quote:
ABC DEF FEGLH

and
Quote:
ABC DEF FEGLH


you should use the UB code - code /code to show examples.

Code:
ABC   DEF   FEGLH

and

Code:
ABC DEF FEGLH


if that is what you mean.
Back to top
View user's profile Send private message
BAJJI

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Fri Nov 17, 2006 6:56 pm    Post subject: Re: Manipulating string in a table
Reply with quote

yes this is what i mean...

now, some one help me out in handling this requirement.

thanks,
Kiran.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri Nov 17, 2006 9:27 pm    Post subject: Re: Manipulating string in a table
Reply with quote

I will assume that english is not your native tongue, thus the very rude usage of ASAP and 'now, someone do my work for me'.

how are you determining that the COLUMN
(fields are in records and working-storage definitions, DB2 Rows do not have fields)
contains more than one space between non-space characters?

This appears to be a 'repair the data' function and suggest that you do it programatically as apposed to SQL.

Though someone could probably generate the necessary sql to determine if the column requires 'repair' and then 'repair' the column, this kind of SQL would require a lot of resources. Would not advise a mass-update. Since you would/should use a cursor, that would mean your data is in the program, so repair it with the programming language you are using.

Before you 'repair' the data, suggest you modify the original INSERT logic to assure that this does not occur, then 'repair' your data.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon Nov 20, 2006 12:34 pm    Post subject:
Reply with quote

what's the meaning of Warnings : 1? how many warnings or different types of warning exists? does it mean a user is banned?....
Back to top
View user's profile Send private message
PascalQ

New User


Joined: 12 May 2006
Posts: 20

PostPosted: Mon Nov 20, 2006 3:59 pm    Post subject:
Reply with quote

acevedo wrote:
what's the meaning of Warnings : 1? how many warnings or different types of warning exists? does it mean a user is banned?....


as the mod said, read the rules icon_lol.gif

they say you're not banned with just 1 warning.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon Nov 20, 2006 4:55 pm    Post subject:
Reply with quote

fwiw:

Edit or Remove
The moderating, support and other teams reserve the right to edit or remove any post at any time. The determination of what is construed as indecent, vulgar, spam, etc. as noted in these points is up to Team Members and not users

Warning
Users abusing these rules will be given One(1) warning only. If the offence is repeated, they will face a possible ban. If you received one or more warning then you are not eligible to participate in the 'MEMBER OF THE MONTH' Contest.

Ban
Users will be warned a maximum of three times for any and all offences in a three month period. If the need arises for a fourth warning a temporary ban will be put in place of between 1 to 3 days. Arguing with team members after having received a warning will lead to an immediate additional warning. Should this exceed three strikes a temporary ban will be put in place as above.

Termination
OUR GOAL IS NOT POPULATION, BUT PERFECTION. So we have the rights to terminate the membership without any notice, if the user is not active for a long period.
Back to top
View user's profile Send private message
BAJJI

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Tue Nov 21, 2006 10:57 am    Post subject: Hi dbzTHEdinosauer..
Reply with quote

Hi dbzTHEdinosauer,

Yes, English is not my native language.

But I sincerely apologize if my wordings spelt rude which i never intended.

Thanks,
Kiran.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us