× 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.



James,

Your pf may not already be keyed. For example, the output from DSPUSRPRF
to an outfile. You can add a primary key constraint on that and now it
can be read with a CHAIN from RPG.
In DDL (as opposed to DDS) a primary key constraint is how you specify
that the PF is keyed, and is the only way.

If you try to create the referential constraint in SQL it will tell you
no, SQL0573.
If you try just
ADDPFCST FILE(ROB/AB2) TYPE(*REFCST) KEY(MYKEY) PRNFILE(ROB/AB)
and AB has no primary key, just
UNIQUE
R ABR
MYKEY 11A
MYDATA 10A
K MYKEY

Then it will implictly add the primary key constraint.
CPI32B9
Message . . . . : Primary key constraint implicitly added.
Cause . . . . . : Primary key constraint Q_ROB_AB_MYKEY_00001 was
implicitly
added to file AB in library ROB. The ADDPFCST command's primary function
was
to add a referential constraint to a dependent file. A parent key,
unique
constraint or primary key constraint, could not be found in the parent
file.
But criteria was met so a primary key constraint could be automatically

generated. This allows the referential constraint to use the generated

primary key constraint as the parent key.

Before the add of the referential constraint
Constraint Type . . . . . . . . . . . . . . : NONE
Number of key fields . . . . . . . . . . . : 1
Record format . . . . . . . . . . . . . . . : ABR
Key field . . . . . . . . . . . . . . . . : MYKEY

After:

Constraint Type . . . . . . . . . . . . . . : PRIMARY
Number of key fields . . . . . . . . . . . : 1
Record format . . . . . . . . . . . . . . . : ABR
Key field . . . . . . . . . . . . . . . . : MYKEY
Sequence . . . . . . . . . . . . . . . : Ascending
Sign specified . . . . . . . . . . . . : UNSIGNED
Zone/digit specified . . . . . . . . . : *NONE
Alternative collating sequence . . . . : No


Rob Berendt

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.