IB - Developer Center    Forums  Hop To Forum Categories  iWay Products    [Solved] Data Migrator - Generate a sequence number
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
JL
Member
Posted
Hi,

We need to generate an incrementing sequence number based on the status in the source records. Say, I have a series of 7 records and for the records with Status = 2, I would like to generate an incrementing series of sequence_key. Example:










RecordStatusSequence_Key
11
221
35
422
51
623
724


I would also like to do this is one pass and not go back through in DM to update the records. Basically, is there a way in DM to get the previous not missing sequence_key and increment by 1.

Thanks!

This message has been edited. Last edited by: JL,


Year(s) of experience in WebFOCUS: 1+. Using WebFOCUS 7.6.7 on Windows platform with SQL Server.
 
Posts: 20 | Registered: September 08, 2008Reply With QuoteReport This Post
Waz
Virtuoso
Posted Hide Post
DM, do you mean Dialog Manager ?


For TABLE FILE

Use
TABLE FILE CAR
PRINT COMPUTE
      SEAT_2_SEQ/I9 = IF SEATS EQ 2 THEN LAST SEAT_2_SEQ + 1 ELSE LAST SEAT_2_SEQ ;

BY MODEL
BY SEATS
END


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 1534 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteReport This Post
JL
Member
Posted Hide Post
Hi Waz,

Actually, I meant the data migrator. I have changed my title to be more precise.

Thanks!


Year(s) of experience in WebFOCUS: 1+. Using WebFOCUS 7.6.7 on Windows platform with SQL Server.
 
Posts: 20 | Registered: September 08, 2008Reply With QuoteReport This Post
Platinum Member
Posted Hide Post
You can do the same thing in Data Management Console but then as a insert column in the SQL box. Then just use the example of Waz:

IF SEATS EQ 2 THEN LAST SEAT_2_SEQ + 1 ELSE LAST SEAT_2_SEQ


Test: WF 7.6.10
Prod: WF 7.6.9
DB: Progress, IBM DB2, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle 9i/10g.
 
Posts: 138 | Location: Europe | Registered: February 05, 2007Reply With QuoteReport This Post
JL
Member
Posted Hide Post
Thanks for the suggestion!

The expression:
SEATS = IF SEATS EQ 2 THEN LAST SEAT_2_SEQ + 1 ELSE LAST SEAT_2_SEQ
gave the following results:










RecordStatusSequence_Key
110
221
351
422
512
623
724


So we created a temporary file to hold the results and used another expression:
SEATS_2_SEQ_NEW = IF SEAT_2_SEQ NE LAST SEAT_2_SEQ THEN SEAT_2_SEQ ELSE MISSING

Thanks for the help!


Year(s) of experience in WebFOCUS: 1+. Using WebFOCUS 7.6.7 on Windows platform with SQL Server.
 
Posts: 20 | Registered: September 08, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 

IB - Developer Center    Forums  Hop To Forum Categories  iWay Products    [Solved] Data Migrator - Generate a sequence number

Copyright © 1996-2010 Information Builders, leaders in enterprise business intelligence.