CLRPFM and CPYF with *REPLACE are not allowed when triggers exist because you are affecting every record in the table.

Your SQL delete will be allowed with the triggers in place. You can verify this by removing the triggers, copying your data in and resetting the triggers. When you run your SQL deletes, the triggers should fire and everything should work as you expect.


-----Original Message----- From: John McKee ; John McKee
Sent: Monday, October 29, 2012 10:28 AM
To: Midrange Systems Technical Discussion
Subject: SQL and trigger s

I was attempting to copy a live data file to our test environment.
Process was intended to refresh the file so I could test the SQL
process to delete records later this week.

Well, first part is to save the test environment file. No issue.
Then, copy and replace records. Doesn't work.

File has three triggers on it. After insert, after update, and after delete.

I am assuming I could disable the triggers in the test environment and
then do the copy. Am I correct? And, on the live environment, would
I have to disable one or more triggers to use SQL to delete selected

Both questions are easily answered by me just doing this in the test
environment. My concern, though, is what might happen to the live
environment if I disable the triggers (all, or just one), do the SQL
delete. and reenable the triggers. I am concerned that I might
introduce an error that causes problems days later. While the system
is going away, a number of accounts will remain on the system to be
worked for some months. I don't want to trash something that will
cause bigger headaches.

I needed to change four fields in one data file. Tedious, as there
are five fields and fourty-eight records. I had "bright idea" - just
use an UPDATE. The contents were updated, sort of. But, when the
file is changed using the approved method, some other changes are
made. Bottom line was that the maintenance program had to be used to
finish the changes. At least that mess was easily fixed.

So, I would like to test the SQL on test environment, but need to
refresh the file. Can't because of the triggers. Will disable allow
CPYF to update the file? What of the triggers? No idea, at this
point, what they do.

Any suggestions?

John McKee

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page