|
Phil, Phil, Something like this: Alter Table RBCLFRH Add Constraint RBCLFRH_RBCLFRD_FK Foreign Key (CLHCO CLHTYP) References RBCLFRD (CLDCO CLDTYP) On Delete Restrict; The file names could be backwards. Hope this helps. Mark Phippard SoftLanding Systems Gord Royle <GRoyle@cott.com> To: "'midrange-l@midrange.com'" <midrange-l@midrange.com> Sent by: cc: midrange-l-admin@mi Subject: RE: SQL drange.com 08/16/01 08:55 AM Please respond to midrange-l Here's a link to IBM Redbooks DB2/400 Advanced Database Functions. Section 3.4.2 has exactly what you need. http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg244249.html? Open Gord -----Original Message----- From: Phil [mailto:sublime78ska@yahoo.com] Sent: Wednesday, August 15, 2001 3:01 PM To: midrange-l@midrange.com Subject: SQL Can someone tell me the equivelent SQL for this OS/400 command: /* ADDPFCST FILE(RBCLFRD) TYPE(*REFCST) KEY(CLDCO CLDTYP) + */ /* PRNFILE(RBCLFRH) DLTRULE(*RESTRICT) */ RBCLFRD is a detail file and RBCLFRH is a header file. I want to ensure no header records can be deleted when detail records exist. The command works great but I want to do it using sql. Thanks, Phil _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l or email: MIDRANGE-L-request@midrange.com Cott - The Leader in Premium Retailer Brand Beverage Innovation. _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l or email: MIDRANGE-L-request@midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.