NYCPHP Meetup

NYPHP.org

[nycphp-talk] Primary keys

PaulCheung paulcheung at tiscali.co.uk
Thu Jul 19 08:19:20 EDT 2007


I want to set up primary keys made up of several fields. Referring to the 
COBOL type example below is it possible to set up group data structures as 
illustrated by ACCOUNT and NAME?



01                  EXAMPLE-RECORD.                 SYNC.

05      ACCOUNT.

10        BRANCH                  PIC 9(6).

10        ACCOUNT-NO        PIC 9(8).

10        PIN                             PIC 9(4).

05    BALANCE                            PIC S9(6)v99        COMP-3

05      NAME.

10         GIVEN                       PIC X(25).

10         SURNAME              PIC X(30).

05    FILLER                                  PIC X(40).



This way I could use ACCOUNT as a primary key or if I so wished I could 
concatenate NAME and ACCOUNT and use that as primary key. Can concatenated 
fields be used as a primary key?



Paul



More information about the talk mailing list