Jump to content
  • 0

Can I create/duplicate 10 new records in table B and assign these the ID of a row from table A?


biota

Question

I have been trying to do this with a simple trigger but it looks not to be possible due to lack of a common value/field.

The first part of the trigger works fine: 

- On insert to table A, insert/duplicate 10 rows from a lookup into table B.

However I need those rows to have the ID of the row in table A which triggers this.

The problem I suppose is there is no relationship with or PK in the lookup table.

The first part could also be achieved by having 10 'dummy' rows in table B, which the trigger then duplicates. This removes the need for a lookup table and reduces the trigger to linking two tables rather than three. It just seems slightly messier in that any additional rows could mess things up.

But if it works I could live with the latter.

It looks at the moment like it might have to be handled by receiving a parameter in the datapage for all this, but that could be very messy also.

Any suggestions welcome!

TIA

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...