Jump to content
Mdarby

using SQL to return script name from the database

Recommended Posts

I am trying to do something similar to @LTRUNBYUSER@ except for getting the script name from the automate database. Currently I have to copy and paste the script name into a variable but I wanna get it from the database instead. If anyone has done this let me know. thanks 

Share this post


Link to post
Share on other sites

This should work from a script (every script already has %scriptid% populated) - to extract the name you then just:

select scriptname from lt_scripts where scriptid='%scriptid%';
 

  • Like 1

Share this post


Link to post
Share on other sites

Partially unrelated notes:

If you are using the Script Run function within a script to run another script immediately within the same script, the value of variable %scriptid% will not change; it will always be the script ID of the parent script, unless you are using Script Run to schedule a script to run in the future (rather than now). Additionally, scripts that are run immediately (not scheduled) through Script Run will not return a Script State (i.e. Success/Failure).

Share this post


Link to post
Share on other sites
On 9/6/2020 at 7:31 PM, WesleyNZ said:

This should work from a script (every script already has %scriptid% populated) - to extract the name you then just:

select scriptname from lt_scripts where scriptid='%scriptid%';
 

thank you

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   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.


×
×
  • Create New...