Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Select Junk Charaters

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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue Dec 11, 2007 1:43 pm    Post subject: Select Junk Charaters
Reply with quote

Can I query a table to select is there any junk characters present in that or not?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Dec 11, 2007 1:45 pm    Post subject: Reply to: Select Junk Charaters
Reply with quote

please clarify the meaning of "JUNK" :-)
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue Dec 11, 2007 1:53 pm    Post subject:
Reply with quote

My query result should not contain any character except

0,1,2,3,4,5,6,7,8,9 or "."
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Dec 11, 2007 6:36 pm    Post subject:
Reply with quote

Are you storing numeric data in a Text field in a database? That is just horrible design.

But you are contradicting yourself. First you ask if you can select junk characters then you say your result should only include
0,1,2,3,4,5,6,7,8,9 or ".". Are those what you are considering junk or are those the only valid characters?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Dec 11, 2007 6:51 pm    Post subject:
Reply with quote

What are formats of the columns?
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Wed Dec 12, 2007 12:43 pm    Post subject:
Reply with quote

Hi

Yrs...the following are the valid characters

0,1,2,3,4,5,6,7,8,9 or "."
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Dec 12, 2007 5:06 pm    Post subject:
Reply with quote

I believe, u r handling some numeric number in CHAR field and in that some junk characters are coming un-expectedly, U want to remove them.

If this is the case, then

with the following wuery u can list out all the fields which contains the junk characters.


SELECT * FROM <TABLE-NAME>
WHERE <FIELD-NAME> BETWEEN '000000' AND '999999'
OR <FIELD-NAME> = '.'
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Dec 12, 2007 5:09 pm    Post subject: Reply to: Select Junk Charaters
Reply with quote

Quote:
BETWEEN '000000' AND '999999'


I would disagree on that, You are carrying on an alphanumeric compare
and with Your comparison "111aaa" would be legal :-)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Dec 12, 2007 5:37 pm    Post subject:
Reply with quote

tables do not have fields. I realize that rookies talk like that, but if you are providing 'professional' help, clean up your rap.
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 SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts replacing junk with hyphen Nitin32 DFSORT/ICETOOL 10 Fri Jun 02, 2017 7:47 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Select first 2 group data vice_versa DFSORT/ICETOOL 10 Mon Jun 13, 2016 2:21 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us