If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > display only fixed digit numbers.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-06, 05:25
anurodhjindal anurodhjindal is offline
Registered User
 
Join Date: Jun 2006
Posts: 2
display only fixed digit numbers.

hi...

i have created a table "ref_nco6"
db2 => describe table ref_nco6

Column Type Type
name schema name Length Scale Nulls
------------------------------ --------- ------------------ -------- ----- -----
NCO_CD SYSIBM CHARACTER 6 0 No
NCO_DET SYSIBM VARCHAR 120 0 Yes
UID SYSIBM CHARACTER 6 0 Yes
DT_STAMP SYSIBM TIMESTAMP 10 0 Yes

Now in NCO_Cd there are 5 digit numbers and 6 digits numbers..and some numbers contain both digit and alphabets...

I have to display only 6 digit numbers...
Kindly help
Reply With Quote
  #2 (permalink)  
Old 06-13-06, 09:16
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
try this WHERE-clause:


... WHERE TRANSLATE ( NCO_CD , '000000000' , '123456789' ) = '000000'


( the digits from 1 to 9 are replaced by zeros. If the result are six zeros, the source was a six digits number )
Reply With Quote
  #3 (permalink)  
Old 06-14-06, 01:14
anurodhjindal anurodhjindal is offline
Registered User
 
Join Date: Jun 2006
Posts: 2
thanks....umayer...its working
Reply With Quote
  #4 (permalink)  
Old 06-14-06, 02:07
rishi_chaudhry rishi_chaudhry is offline
Registered User
 
Join Date: May 2006
Posts: 1
I want to convert a form from 9i to 6i can anyone one plz tell me how can i do that because it is giving the error rs-30200.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On