Skip to main content
Solved

What is the use of multiple templates within a control procedure?

  • November 13, 2020
  • 3 replies
  • 78 views

Forum|alt.badge.img+5

I always thought that there could be one template to a control procedure, but just saw that it actually is possible to have more than one template to a control procedure.
Hope that someone tell me why they use multiple templates within the same control procedure. I'd like to know the advantages of using multiple templates.

Best answer by Erwin Ekkel

This can be used if you have the same objects but you need some templates only in a certain object. Example: If you have insert/update and delete trigger on a table you can have template A, B and C. 

Update trigger has template A + B

Insert trigger has template   B + C

delete trigger has template  C

Now you need only 1 proc to house all the templates and you assign the necessary templates to the objects. Instead of 3 procs that you assign to multiple objects. 

One advantage is that you have all available templates in the same control proc. Otherwise you would have to switch between control procs. And you can keep the naming more object focused something like triggers_table_A instead of trigger_check_for_duplicates. Making the search for the template to amend easier. 

It's like you said it adds more structure if done correctly. 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

3 replies

Blommetje
Forum|alt.badge.img+13
  • Partner
  • 209 replies
  • November 13, 2020

I also discovered this way late. I did merge all my seperate procs to one, and made different templates.

Not sure if this is better technically. However, is creates a lot more structure/overview.

 

 


Forum|alt.badge.img+17
  • Moderator
  • 761 replies
  • Answer
  • November 13, 2020

This can be used if you have the same objects but you need some templates only in a certain object. Example: If you have insert/update and delete trigger on a table you can have template A, B and C. 

Update trigger has template A + B

Insert trigger has template   B + C

delete trigger has template  C

Now you need only 1 proc to house all the templates and you assign the necessary templates to the objects. Instead of 3 procs that you assign to multiple objects. 

One advantage is that you have all available templates in the same control proc. Otherwise you would have to switch between control procs. And you can keep the naming more object focused something like triggers_table_A instead of trigger_check_for_duplicates. Making the search for the template to amend easier. 

It's like you said it adds more structure if done correctly. 


Forum|alt.badge.img+5

Thank you Blommetje & Erwin,

Thanks to your replies, I'm starting to use this feature more often. For instance with process flows. Instead of having each task/process in its own control procedure I now have just one control procedure (or two if I have both tasks and processes) with all associated templates. This is much easier to keep them organized, plus I can generate and deploy them at the same time.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings