MySQL Forums
Forum List  »  Triggers

trigger with a loop insert
Posted by: m s
Date: March 07, 2006 08:47AM

Hi,

I am trying to create an insert trigger that will create multiple (always 1 or more) records in a second table, based on information from the first

The first table has an identifier field and an item count. The value of the count is how many records are created in the secondary table, and the value to be inserted is a substring of the identifier field, plus an incrementing count of where in the loop we are.

Table1:
ID:988977911111
Count:3

To be inserted into the second table
9889779001
9889779002
9889779003
(first 7 characters of the identifier field, and the value of i, from 001 to the value of count)

Thanks in advance if you can help!

Options: ReplyQuote


Subject
Views
Written By
Posted
trigger with a loop insert
12628
m s
March 07, 2006 08:47AM
9485
March 07, 2006 03:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.