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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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