Skip to main content
Solved

Pass Table Name Parameter to a Script Action


I have a generic stored procedure that does some custom post processing based on the table that has just been reloaded (Executed).  The stored procedure takes a parameter "TableName".  I've created a Script Action that executes the stored procedure.  I need this Script Action to run as a Post Step after the last execution step is run for one of several tables.  I can create one script action per table with the tablename hardcoded, but I've got a lot of tables to work with and would really prefer do this as a parameter containing the current table name.  Is the currently executing table name available in a system parameter somewhere and/or is there a way to create one that can be referenced by a script action?

Best answer by JTreadwell

Hi Larry, the below solution is about as close as you can get to what you are looking for: 

  1. Create a SQL Snippet & parameterize the TableName in the snippet.
  2. Create a script action from the SQL snippet, and map the table to the parameter once for that snippet. (this will replace all instances of the parameter with the actual table name) Just be sure you specify the table variant (Raw or Valid table).
  3. Repeat step 2 for each table.

 

View original
Did this topic help you find an answer to your question?

4 replies

JTreadwell
Employee
Forum|alt.badge.img+5
  • Employee
  • 179 replies
  • Answer
  • May 13, 2021

Hi Larry, the below solution is about as close as you can get to what you are looking for: 

  1. Create a SQL Snippet & parameterize the TableName in the snippet.
  2. Create a script action from the SQL snippet, and map the table to the parameter once for that snippet. (this will replace all instances of the parameter with the actual table name) Just be sure you specify the table variant (Raw or Valid table).
  3. Repeat step 2 for each table.

 


  • Starter
  • 3 replies
  • September 26, 2024

Is this still the only way to handle 1 procedure to multiple tables (timextender classic)?

JTreadwell wrote:

Hi Larry, the below solution is about as close as you can get to what you are looking for: 

  1. Create a SQL Snippet & parameterize the TableName in the snippet.
  2. Create a script action from the SQL snippet, and map the table to the parameter once for that snippet. (this will replace all instances of the parameter with the actual table name) Just be sure you specify the table variant (Raw or Valid table).
  3. Repeat step 2 for each table.

 

 

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • September 26, 2024

Hi @malkn 


Yes. If you want to reuse a script, creating it as a snippet with this option is the way to do it.

Is there some issue this does not resolve?


  • Starter
  • 3 replies
  • September 27, 2024

No, I don’t think so, all is good.


Reply


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