Skip to main content
Question

Looking for sample python code to replace Database Uploader - SQL Server


salvaleonrp
Enthusiast
Forum|alt.badge.img+15

I have these parameters for database Uploader transformer and I'd like to do the same thing on a python shutdown script so I don't need to have a parent and child workspace for capturing log information. Looking for some python samples to do this with SQL Server. Thanks.

 

3 replies

david_r
Celebrity
  • January 27, 2020

Rather than using a shutdown script, why not replace the writers with FeatureWriters and connect the DatabaseUpdater to the Summary output port? You can use the DateTimeStamper and the DateTimeCalculator to calculate the duration.


salvaleonrp
Enthusiast
Forum|alt.badge.img+15
  • Author
  • Enthusiast
  • January 27, 2020
david_r wrote:

Rather than using a shutdown script, why not replace the writers with FeatureWriters and connect the DatabaseUpdater to the Summary output port? You can use the DateTimeStamper and the DateTimeCalculator to calculate the duration.

I did not think hard enough. I have a Date time stamp as part of my shutdown script even if it's not necessary for what I wanted to do. Since I knew that the Session duration will only be logged upon completion of the workbench file, I insisted to get that the info come from the log file itself. Thanks, this comment answered a few other things that would complete my solution.


david_r
Celebrity
  • January 27, 2020
salvaleonrp wrote:

I did not think hard enough. I have a Date time stamp as part of my shutdown script even if it's not necessary for what I wanted to do. Since I knew that the Session duration will only be logged upon completion of the workbench file, I insisted to get that the info come from the log file itself. Thanks, this comment answered a few other things that would complete my solution.

Glad to hear and happy to be of help. The FeatureReader / FeatureWriter pair is exceptionally useful and allows you to easily implement a lot of common usage patterns within a single workspace, often with no coding (compared to using startup and shutdown scripts).


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