The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now!
A chart showing the TIBCO Platform vision
Jump to content
Forums
Ask questions and gain insight from discussions

Recommended Posts

Posted

Hi

I am wondering how to extract resourcename and path of the script that is currently executed. I would want to include a standard exception routine at the end of each scrip to email out the resource name and path that was being executed. Are there any system properties or any workaround to get that details like we can get username of the user under which script is being executed using

CALL getproperty('CURRENT_USER_Name', l_username);

  • 2 weeks later...
Posted

You can try using CURRENT_EXCEPTION.TRACE to get the stack trace, and if needed, parse that to only return e.g the first line

 

Or, you could try getProperty on TRANSACTION_ID, and use SYS_REQUESTS afterward to identify the resource name.

Posted
I did tried this workaround, but i do not see any of this will return Resource ID or Path by any chance. We can get the text (Whole Script) but not the path or ID! Do you have a code to showcase how to extract path or id from Exception trace and ID by any chance
Posted

I don't have access to an instance in order to provide a fully tested code snippet. 

 

My suggestion would be to catch the exception, store the message in a variable, and do something like REGEXP_EXTRACT to get the path.

 

Less of a hack would be to use getProperty to get the TRANSACTION_ID.

 

Even less of a hack, would be to look this up after the fact from the system tables.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...