× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



When I look at the field definitions within the files, I'm seeing fields
that seem to be pointing to other files

It seems that you are talking about a foreign key. When a foreign key is created between a parent and child file then any record you added to the child file must have a record in the parent file with the same key value. So let's say you try to copy the child table from production to test using the CPYF command put do nothing with the parent table, it could be possible that you copy records that have parents in production but not in the test file. Once you realize that's the problem, you might try copying over the parent file first... however, there's a parent key in test that has records in the child file (in test) and the foreign key restricts a delete, so the cpyf file fails again.

The best option for doing this would be

DELETE FROM TEST/CHILDTABLE

DELETE FROM TEST/PARENTTABLE

INSERT INTO TEST/PARENTTABLE
OVERRIDING SYSTEM VALUE
SELECT * FROM LIVE/PARENTTABLE

INSERT INTO TEST/CHILDTABLE
OVERRIDING SYSTEM VALUE
SELECT * FROM LIVE/CHILDTABLE


Overriding system value will allow you to copy the auto-generated identity column from one file to the next. However, you will need to reseed you next starting number in the test file. If you do not have auto-generated identity columns, then you don't need that part.



-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Paul Nelson
Sent: Wednesday, October 26, 2011 12:34 PM
To: 'Midrange Systems Technical Discussion'
Subject: Dumb SQL question

One of my clients is getting ready to roll out an upgrade to their
application software, and the vendor has plunged down the SQL path.

When I look at the field definitions within the files, I'm seeing fields
that seem to be pointing to other files, even thought the software is still
using standard DDS keyed logical files.

What are these extra fields needed for? The vendor is telling my customer
that eventually, utilities like CPYF can't be used against a file with these
ID's.

Is the vendor blowing smoke?

Paul Nelson
Office 512-392-2577
Cell 708-670-6978
nelsonp@xxxxxxxxxxxxx



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

________________________________

Notice from Bob Evans Farms, Inc: This e-mail message, including any attachments, may contain confidential information that is intended only for the person or entity to which it is addressed. Any unauthorized review, use, disclosure or distribution is strictly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.