Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > How to implement mod10 in oracle...Quick help needed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-07, 03:59
ashish nahata ashish nahata is offline
Registered User
 
Join Date: Feb 2006
Posts: 7
How to implement mod10 in oracle...Quick help needed

I have generated a sequence and referred to dual table to pass the next value in the function.
Like select x_seq.nextval into v_seqvalue from dual (v_seqvalue varchar2(10)) inside the function..

I want to implement MOD10 function on v_seqvalue.
MOD10 Logic says that every 2nd digit from right to left should get doubled(or multiply by 2) and the digit doubled if greater than 10, then it should be subtracted by 9 .Finally the sum of all the digits will be divided by 10. this mod I will be concatenating with theinput v_seqvalue and will return it.
For Example..
1234567890 becomes 2264165890 (9+9=18>10 so 18-9=9and so on..)

How could I achieve this ?
Thanks in advance...
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

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