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     data entry form in Maintain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
data entry form in Maintain
 Login/Join
 
<Vijaya_settu>
posted
I am creating a data entry form in Maintain. I have one key field "STUDENT_ID"in SQL database. So it is taking only unique value. For example, if I enter this STUDENT_ID "1111" in my form , it allow me to enter first time . But I want to enter the same field STUDENT_ID value “1111" Many times. I want to make this field "STUDENT_ID" as second key. Is it possible, Can I define a new field in the master file and make it as Primary key field? I appreciate any suggestion regarding this issue.

My Master file Below:
FILENAME=ASSISTLEARNLAB, SUFFIX=SQLMSS , $
SEGMENT=ASSISTLEARNLAB, SEGTYPE=S0, $
FIELDNAME=STUDENT_ID, ALIAS='Student ID', USAGE=A7V, ACTUAL=A7V,
TITLE='Student ID', $
FIELDNAME=LAST_NAME, ALIAS='Last Name', USAGE=A50, ACTUAL=A50,
MISSING=ON,
TITLE='Last Name', $
FIELDNAME=FIRST_NAME, ALIAS='First Name', USAGE=A50, ACTUAL=A50,
MISSING=ON,
TITLE='First Name', $
FIELDNAME=DATE, ALIAS=Date, USAGE=YYMD, ACTUAL=DATE,
MISSING=ON, $
FIELDNAME=COURSE, ALIAS=Course, USAGE=A10, ACTUAL=A10,
MISSING=ON, $
FIELDNAME=DETAILED_REASON_FOR_VISIT, ALIAS='Detailed Reason for visit', USAGE=A50, ACTUAL=A50,
MISSING=ON,
TITLE='Detailed Reason for visit', $
FIELDNAME=TUTOR, ALIAS=Tutor, USAGE=A50, ACTUAL=A50,
MISSING=ON, $

My Access file below:
SEGNAME=ASSISTLEARNLAB, TABLENAME=Maintain.webfocus.AssistLearnLab,
CONNECTION=MAINTAIN, KEYS=1, $

My Maintain Code:
MAINTAIN FILE assistlearnlab

$$Declarations

Declare CNT / I2 ;

Case Top
Infer assistlearnlab.ASSISTLEARNLAB.STUDENT_ID into AddAssistlearnlabStk2;
Infer assistlearnlab.ASSISTLEARNLAB.STUDENT_ID into GetAssistLearnStack;

Winform Show_Inactive Form1;
Compute Form1.cssname = '/APPROOT/MAINTAIN/FAN.CSS';
Winform Show Form1;
-* Replace the Winform Show command with the following code
-* when to display your form in a non-persistent state
-* Winform Show_and_exit Form1;
EndCase

Case AddAssistLearn
For all include assistlearnlab.ASSISTLEARNLAB.STUDENT_ID from AddAssistlearnlabStk2;
Reposition assistlearnlab.ASSISTLEARNLAB.STUDENT_ID ;
Stack clear AddAssistlearnlabStk2 ;
EndCase

Case GetAssistLearn
Reposition assistlearnlab.ASSISTLEARNLAB.STUDENT_ID ;
Stack clear GetAssistLearnStack;
For all next assistlearnlab.ASSISTLEARNLAB.STUDENT_ID into GetAssistLearnStack ;
EndCase


Case UpdateAssitLearn
Update assistlearnlab.ASSISTLEARNLAB.LAST_NAME
assistlearnlab.ASSISTLEARNLAB.FIRST_NAME
assistlearnlab.ASSISTLEARNLAB.DATE
assistlearnlab.ASSISTLEARNLAB.COURSE
assistlearnlab.ASSISTLEARNLAB.DETAILED_REASON_FOR_VISIT
assistlearnlab.ASSISTLEARNLAB.TUTOR from GetAssistLearnStack(GetAssistLearnStack.FocIndex) ;
EndCase

Case DeleteAssistLearn
Delete assistlearnlab.ASSISTLEARNLAB.STUDENT_ID from GetAssistLearnStack(GetAssistLearnStack.FocIndex) ;
IF GetAssistLearnStack.FocCount=GetAssistLearnStack.FocIndex THEN
BEGIN
COMPUTE GetAssistLearnStack.FocCount = GetAssistLearnStack.FocCount-1;
COMPUTE GetAssistLearnStack.FocIndex = GetAssistLearnStack.FocIndex-1;
ENDBEGIN
ELSE
BEGIN
COMPUTE CNT = GetAssistLearnStack.FocIndex;
Stack copy from GetAssistLearnStack(CNT+1) into GetAssistLearnStack(CNT) ;
COMPUTE GetAssistLearnStack.FocCount = GetAssistLearnStack.FocCount-1;
ENDBEGIN
Winform close UpdatedeleteAssitlearn;
EndCase


END
 
Report This Post
Master
posted Hide Post
Maintain requires that your key fields are first n fields in your Master. So, you COULD enter a second field and make that and STUDENT_ID the key fields, but you will have to recreate the database. Here I am adding STUDENT_CNT (count) as the second key in the Master. You also have to change the KEYS in the Access file to 2.

FILENAME=ASSISTLEARNLAB, SUFFIX=SQLMSS , $
SEGMENT=ASSISTLEARNLAB, SEGTYPE=S0, $
FIELDNAME=STUDENT_ID, ALIAS='Student ID', USAGE=A7V, ACTUAL=A7V,
TITLE='Student ID', $
FIELDNAME=STUDENT_CNT, ALIAS='Student Count', USAGE=I3, ACTUAL=I3,
TITLE='Student Count', $
FIELDNAME=LAST_NAME, ALIAS='Last Name', USAGE=A50, ACTUAL=A50,
MISSING=ON,
TITLE='Last Name', $
FIELDNAME=FIRST_NAME, ALIAS='First Name', USAGE=A50, ACTUAL=A50,
MISSING=ON,
TITLE='First Name', $
FIELDNAME=DATE, ALIAS=Date, USAGE=YYMD, ACTUAL=DATE,
MISSING=ON, $
FIELDNAME=COURSE, ALIAS=Course, USAGE=A10, ACTUAL=A10,
MISSING=ON, $
FIELDNAME=DETAILED_REASON_FOR_VISIT, ALIAS='Detailed Reason for visit', USAGE=A50, ACTUAL=A50,
MISSING=ON,
TITLE='Detailed Reason for visit', $
FIELDNAME=TUTOR, ALIAS=Tutor, USAGE=A50, ACTUAL=A50,
MISSING=ON, $

My Access file below:
SEGNAME=ASSISTLEARNLAB, TABLENAME=Maintain.webfocus.AssistLearnLab,
CONNECTION=MAINTAIN, KEYS=2, $


Now you can have multiple student IDs and just increment STUDENT_CNT each time.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Expert
posted Hide Post
Mark is right, make sure the first n fields are your keys, and set the Keys in the ACX to match.

I would suggest using a date time field for the other Key, as you will not have to keep track of any counter to increment.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
<Vijaya_settu>
posted
Thank you both of you, Now I able to add values many times to The Student_ID" Field.

Vijaya
 
Report 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     data entry form in Maintain

Copyright © 1996-2020 Information Builders