Normal Topic Translation Q&A many lines into Sesame natural lin (Read 721 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Translation Q&A many lines into Sesame natural lin
Feb 17th, 2007 at 5:50am
Print Post Print Post  
Translating Q&A multilines to Sesame natural linking.

I have two Q&A databases. CLIENTS with about 30 fields. and RECORDS with about 20 fields that are identical to CLIENTS and get value with XLU from CLIENTS, five more Client data fields, plus twelve lines of data, each line with 10 pieces of information.  Each line represents data for one month.

Trying to move to Sesame in stages.
Stage 1 was done so could keep working in Sesame with old Q&A structure
1.  Translated CLIENTS with no problems.
2.  Translated RECORDS witn no problems.
This works but does not take advantage of subforms, single data entry, no XLUs, etc.  Need to do that now in stage 2

Stage 2 was done to create natural linking database with subform inside CLIENTS, replacing RECORDS.
1.  In Q&A, copied RECORDS into TEMP with 20 common fields, and five other client fields.
2.  Added one field for the month, and added 10 fields for the data for that month.
3.  Copied records 12 times from RECORDS into TEMP.  Each time copying the 25 Client fields, and only the 10 lines for each of the months.  This resulted in one single record for each month for each Client, the records needed for the Sesame subform, twelve records for each client vs. only one record previously.
4.  Then Translated the new TEMP into Sesame with no problem.
5.  Opened the Sesame application with CLIENTS and RECORDS, and merged TEMP.
6.  Added a tab with subform to CLIENTS.  The subform calls for the TEMP form with natural linking using ClientID field.
7.  TEMP is now shown as sub to CLIENTS, looks good.
7.  Opened Clients and found no records in subforms.
     PROBLEM:  I now expected to see twelve records on the subform for each client

I seem to have all the data, separate records, but the linking did not appear to happen.  What is the best way to fix this?      
  
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Translation Q&A many lines into Sesame natural
Reply #1 - Feb 18th, 2007 at 8:22pm
Print Post Print Post  
Its been awhile since I have done it but I believe you have to first set it for relational linking, then after that is accomplished then export the file, reset it to natural linking and reimport the records.
  
Back to top
 
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Translation Q&A many lines into Sesame natural
Reply #2 - Feb 20th, 2007 at 3:15am
Print Post Print Post  
Thank you Poppy.

To recap the steps for me:
Remove the natural link subform I have now
Make a new subform with Relational link
Export all records from Clients
Delete all records from Clients
Delete all records from Records
Import the export file into Clients
Make a subform with natural links.


OR


To recap the steps for me:
Remove the natural link subform I have now
Make a new subform with Relational link
Export all records from Records
Delete all records from Records
Import the export file into Records
Make a subform with natural links.

Thank you again in advance.
  
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Translation Q&A many lines into Sesame natural
Reply #3 - Feb 20th, 2007 at 2:17pm
Print Post Print Post  
Simply put I would backup everything, then delete all the records, then in s-designer change to relational linking, then in Sesame reimport the records , then look at them to make sure they are correctly linked then export them to a txt file, delete all records, in s-desiger change back to natural linking, in Sesame then reimport them from the txt file, worked like a charm for me. Wink

I received the following I think from technical support way back.


In Q&A you have (for simplicity's sake) two flat databases. Lets call them database A and database B. The records in database B, are "related" as children to the records in database A. In Q&A, that "relationship" is caused by an XLookup statements in Q&A Basic that find some of the records in database B, while you are looking at a single record in database A. This is done (usually) by field matching. In other words, there is a field in A that has a value that matches a particular field in B. In Q&A this doesn't really move the record from B to under the record in A - it can just retrieve information from the record in B - because Q&A is entirely flat.

In Sesame, you can have subform and sub-databases. So you translate A and B into Sesame - you end up with two flat databases and two flat forms. You can then merge B into A, creating a single application file containing both A and B, both still flat. So you create a subform field on A and tell it to contain records from B.

All well and good, and from what I've read so far on this thread, this is where you are now. But there still has to be a way for the A form to know which B records should appear under which A records. In Sesame there are two ways for this to happen: "natural linking" and "relational linking".

In natural linking sub-records appear under a parent record because that is where they were created in the first place - there is no need for matching "key" fields or anything else - it got made here, so here it stays. Natural linking can't immediately help you because your records have already been created elsewhere.
In relational linking (an option available when you created the subform field on the parent form) you tell Sesame which field on the parent and which field on the child need to match for a record from B to appear under a record in A. Sesame then dynamically finds and displays all of the correct B records each time you view an A record. It does this by running through the B database looking for those B records that have the same value as the specified field in the current A record.

You probably don't want to use relational linking permanently because it is slower and does require maintenance. But you can set up your system to use it once - to find the right subrecords, then using the ASCII export save that relationship. Then you can rebuild your subform field with natural linking and import the data back in.

1. Translate A.
2. Translate B.
3. Load A into Sesame.
4. Merge B into A.
5. In SDesigner, Create a subform field on A's form that contains B's form.
6. Tell SDesigner that you want it to be a relational subform and tell SDesigner which fields need to match (one field on the parent form and one field on the subform).
7. In runtime, using the export spec, export all of the fields on the parent and child to a file.
8. In Runtime delete the records from the child form and from the parent form, using mass delete.
9. In Sdesigner remove the subform field from the parent form. Then, recreate it just like you made it before, but this time select "natural linking" (the default), instead of relational.
10. In runtime, do an ASCII import from the file you created when doing the export (step 7).

When step 10 is completed, you will have the correct child records under the correct parent - naturally linked.

I know that I am being more conceptual than specific, but once you understand what is going on, the specific steps get a lot easier. The most important thing is understanding that you need to tell Sesame some way to determine which subrecords appear under which parent. In you case that may be a "lot number" field that needs to match on the parent and the child.

Sounds terrible but took about 30-min. Good Luck !!!
  
Back to top
 
IP Logged