A bit of mathermatics
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


A bit of mathermatics Expand / Collapse
Author
Message
Posted 10/6/2009 6:20:38 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2 days ago @ 11:38:39 AM
Posts: 111, Visits: 99
Hi.

I have a formula to calculate a unique transaction sequence number that works as follows:

transaction sequence(TS) * 100 + record sequence(RS)

So take two examples:
118(TS) * 100 + 103(RS) = 11903
99(TS) * 100 + 50 = 9950

From the results I need to be able to get back to determine the original TS and RS.
The solution has to work for both examples above.
So in the case of 11903 I need to get back to 118 and 103 and in the case of 9950 I need to get to 99 and 50.

Any help thouroughly appreciated.
Post #17035
Posted 10/6/2009 6:31:03 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2 days ago @ 7:45:03 AM
Posts: 39, Visits: 169
I don't think, it would be possible because no. of digits in RS is varying and the key point is it could be more then 2
Post #17036
Posted 10/6/2009 6:58:37 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2 days ago @ 11:38:39 AM
Posts: 111, Visits: 99
Thanks Pawan - exactly what I was thinking. Oh well it wasn't critical anyway, I have an alternative just not a mathematical one.
Post #17038
Posted 10/21/2009 8:04:44 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2 days ago @ 11:38:39 AM
Posts: 111, Visits: 99
FYI I think this algorithm will work apart from the first examples where the TS and RQ cross over which gives me another option:

seq_id / 100 as TS;
seq_id mod 100 as RS;
Post #17123
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 7:19pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.266. 8 queries. Compression Disabled.