Home » SQL & PL/SQL » SQL & PL/SQL » Manipulating triggers during insert
Manipulating triggers during insert [message #218805] Sat, 10 February 2007 10:18 Go to next message
pakcikkantin
Messages: 4
Registered: February 2007
Junior Member
Greetings
I have 2 tables customer_production and customer_backup
Both have identical columns
customer_production
name
mobileno
registerdate

I have a situation where before a new record insert into customer_production it must check wether the current customers mobileno exists in the customer_production table. If there is a record then i must move it from customer_production to customer_backup therefore i can only have only 1 unique mobileno for customer.
There is a condition where if the new record comes in with registerdate less than current record in customer_production the RECORD MUST GO INTO customer_backup.
Can it be done in a trigger

Tq

Re: Manipulating triggers during insert [message #218827 is a reply to message #218805] Sat, 10 February 2007 20:25 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>Can it be done in a trigger
Yes, if you know what you are doing.
Re: Manipulating triggers during insert [message #218898 is a reply to message #218805] Sun, 11 February 2007 23:23 Go to previous message
tarmenel
Messages: 63
Registered: February 2007
Location: Israel
Member

I normally try to first use messages or comments field with the values I want to insert just to see what the result may be becasue the logic you may be thinking should happens is not always the case with triggers and some operations done in the background are often times confusing to me. Try seeing the results with messages first and then you can get an idea of what the affect may be.
Previous Topic: Count rows before inserting data.
Next Topic: time duration
Goto Forum:
  


Current Time: Thu Dec 08 01:57:18 CST 2016

Total time taken to generate the page: 0.10777 seconds