fhg
Volume 8, Number 18 -- May 7, 2008

Replace the Contents of a Physical File That Has Triggers

Published: May 7, 2008

Hey, Ted:

I need to copy the contents of a physical file from our production system to its counterpart in our development system, which is a separate logical partition. I have several ways to copy the file from the production system to the development system. However, error messages I get say that I cannot replace the data because the database file has triggers over it. Help!

--Tricia


You need to disable the triggers. Disabling triggers is most easily done if all of the triggers are active. Use Change Physical File (CHGPF) to disable the triggers.

CHGPFTRG FILE(MYLIB/MYFILE) TRG(*ALL) STATE(*DISABLED)

Then copy the data.

CPYF FROMFILE(YOURLIB/YOURFILE) +
        TOFILE(MYLIB/MYFILE) MBROPT(*REPLACE)

And re-enable the triggers.

CHGPFTRG FILE(MYLIB/MYFILE) TRG(*ALL) STATE(*ENABLED)

If the file has one or more disabled triggers, note the names of the disabled triggers so that you will be able to re-enable the right ones. The easiest way is to run DSPFD ... OUTPUT(*PRINT) before disabling the triggers. Then you'll be able to enable or disable triggers one at a time, as illustrated by the following command.

CHGPFTRG FILE(MYLIB/MYFILE) TRG(AFTDELETE) +
            TRGLIB(MYLIB) STATE(*ENABLED)

--Ted




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
PROFOUND LOGIC SOFTWARE

Need Results Fast?
Web-enable with Genie!

                                                          · Easy Installation
                                                          · Codeless Customizations
                                                          · Instant Results

With Genie on your side, you can be
modernized in less than a day. Simply
install, customize, and deploy.

See the magic of Genie today.

Download a FREE 30-day trial at
www.profoundlogic.com


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Edwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

COMMON:  Join us at the Focus 2008 workshop conference, October 5 - 8, in San Francisco, California
MoshiMoshi:  An Interactive Experience for the System i Community. See Episode 1 now!
Help/Systems:  Explore operations automation and BI, June 17 - 20, 2008, Minneapolis, MN


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
Getting Started with PHP for i5/OS: List Price, $59.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket Developers' Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
iSeries Express Web Implementer's Guide: List Price, $59.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
WebFacing Application Design and Development Guide: List Price, $55.00
Can the AS/400 Survive IBM?: List Price, $49.00
The All-Everything Machine: List Price, $29.95
Chip Wars: List Price, $29.95


 
The Four Hundred
IBM Previews "Blue Business" SMB System Sales Approach

Micro Focus to Acquire NetManage for $73.3 Million in Cash

Power Systems: The Feeds and Speeds

There's No i in Future, But Is There a Future in i?

IBM Cuts CPU Prices on Power5 and Power5+ Servers

The Linux Beacon
The Linux Ecosystem to More than Double to $49 Billion

IBM Goes Stateless and Cooler with iDataPlex Servers

IBM Previews "Blue Business" SMB System Sales Approach

As I See It: That Competitive Bug

Power Systems: The Feeds and Speeds

Four Hundred Stuff
GDCM Seeks to 'Defrag' the Data Center for Higher Efficiency

Bsafe Updates Security Tools for i OS

GeneXus Brings Web 2.0 Home with Version X

Terminix Overcomes Hurdle to New B2B System, Thanks to LANSA

NSPI Launches CBU as a Service Offering

Big Iron
Micro Focus to Acquire NetManage for $73.3 Million in Cash

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
May 3, 2008: Volume 10, Number 18

April 26, 2008: Volume 10, Number 17

April 19, 2008: Volume 10, Number 16

April 12, 2008: Volume 10, Number 15

April 5, 2008: Volume 10, Number 14

March 29, 2008: Volume 10, Number 13

The Windows Observer
Operations Manager 2007 Goes Cross-Platform, Hooks Into Tivoli, OpenView

Micro-Hoo: Where Does It Stand Now?

Record Revenues for Microsoft, But Forecast Downgraded

Message for Windows XP Fans Seeking to Save OS: Get Over It

Beta of BizTalk Server R3 Expected Later This Year

The Unix Guardian
Sun Books a Small Loss on a Tiny Revenue Decline, Cuts Jobs

Solaris 10 5/08 Supports Legacy Containers, Xeon Features

Sun Taps Splain to Run Microelectronics, Buys Montalvo Carcass

As I See It: That Competitive Bug

Vision Moves Product and Business Plans Forward

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

Help/Systems
Profound Logic Software
WorksRight Software


Printer Friendly Version


TABLE OF CONTENTS
Accurate Program References

Replace the Contents of a Physical File That Has Triggers

Admin Alert: How to Recreate/Restore a System Distribution Directory

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
Java Messages

Restrict *cmd to specific user

Copying recs from a subfile to a file and keeping highlights

Imbedded SQL

CPYFRMSTMF problem

CPYTOIMPF problem





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement