Results 1 to 6 of 6

Thread: Triggers

  1. #1
    Join Date
    Aug 2003
    Posts
    328

    Unanswered: Triggers

    I want to import data into an Oracle table from SQL Server. I need to do this once a week for a certain table. I need the Oracle table to be truncated before the new data from the new week is inserted. I already have a trigger on the Oracle table to not let nulls in from a certain field. Can I make another trigger that will truncate the table? And how can I be sure that the truncate trigger will fire before the delete_nulls trigger?
    Thanks.

  2. #2
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    140
    How do you plan to transfer the data ? (SQLLoader, DTS, transparent gateway, ...)

    What would be the event that will fire the trigger that should truncate the Oracle table ?

  3. #3
    Join Date
    Aug 2003
    Posts
    328
    I will do it with the DTS. I have a trigger in Oracle already to truncate the table, but I also do not want certain rows to go into the table during the data migration.
    Thanks

  4. #4
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    140
    I'm not sure I got it right, but :

    1. I gues your delete_null trigger is a INSTEAD OF INSERT trigger fired from your Oracle table, is that right ?

    2. I don't think you will be able to create a trigger fired from this very same Oracle table (on what event ?) that truncates itself.

    I'm afraid I simply don't get it. Sorry.

  5. #5
    Join Date
    Aug 2003
    Posts
    328
    I have a table in SQL Server. I want to transfer this table to Oracle. In my SQL Server table there are values with null that I don't want in the Oracle table. The problem is, that when I transfer the table to Oracle, the data thats in the Oracle table from another data transfer is still there. I want to truncate the Oracle table and then transfer the data from SQL Server to the empty Oracle table, but without the lines with the null values. Is this a better explanation?
    Thanks.

  6. #6
    Join Date
    Apr 2004
    Location
    Celebration, Fl
    Posts
    1
    Since you are using a DTS package, why not use SQL to select only the rows from the SQL Server you want to insert? You could also use a Truncate or Delete task first and forget about the Oracle triggers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •