Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Include Auto-increment fields with Maintain ??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Include Auto-increment fields with Maintain ??
 Login/Join
 
Platinum Member
posted
My customer has a number of SQL2005 tables with 'Identity' fields - those auto-incrementing keys that won't take a key value.

I have tried a number of ways to Include a new record in these tables, but none of them have worked so far.

What is the correct way for Maintain to add new records to these type of datasources ?

BTW it is WebFocus 7.1.3 TIA,

Dave Ayers


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Master
posted Hide Post
Dave
With Maintain you need into reference the field in the stack, but not reference in the INCLUDE statement. So, assume you Master looks like this:

FILE = MNTAUTO , SUFFIX = SQLMSS ,$
SEGNAME = MNTAUTO , SEGTYPE = S0 ,$
FIELD = CONTROL ,CONTROL ,I11 ,I4 ,MISSING = OFF, FIELDTYPE = R,$
FIELD = LASTNAME ,LASTNAME ,A12 ,A12 ,MISSING = OFF,$
FIELD = FIRSTNAME ,FIRSTNAME ,A12 ,A12 ,MISSING = OFF,$
FIELD = ITEM ,ITEM ,A20 ,A20 ,MISSING = OFF,
$FIELD = AMOUNT ,AMOUNT ,P19 ,P10 ,MISSING = OFF,$

Here. CONTROL is the Identity field. The MAINTAIN code would be:

MAINTAIN FILE MNTAUTO
INFER CONTROL LASTNAME FIRSTNAME ITEM AMOUNT INTO INSTK
PERFORM UPDAT1

CASE UPDAT1
COMPUTE INSTK(1).LASTNAME = 'PIG';
COMPUTE INSTK(1).FIRSTNAME = 'PORKY';
COMPUTE INSTK(1).ITEM = 'PORKBELLIES';
COMPUTE INSTK(1).AMOUNT = 2000.00;
FOR 1 INCLUDE LASTNAME FIRSTNAME ITEM AMOUNT FROM INSTK
ENDCASE
END

The INFER command loads all of the fields into the stack. When you perform the INCLUDE you can list all BUT the CONTROL field. This technique will take advantage of the Identity field, and still allow you to Include records. I hope this helps.

Mark Derwin
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Mark,

I didn't realize that one could specify a subset of the stacks fields in an INCLUDE.

I modified my code, but it still has a problem, which I now think may be due to a funky data adaptor setup.

Thanks,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Master
posted Hide Post
Dave
The rule with INCLUDE is that you only have to list the key fields. However, in this case we get around the Identity key issue by listing other fields. Note that every field besides the identity field WILL be included.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Include Auto-increment fields with Maintain ??

Copyright © 1996-2020 Information Builders