Skip to main content
Question

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

  • January 24, 2020
  • 3 replies
  • 7 views

salvaleonrp
Enthusiast
Forum|alt.badge.img+20

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.

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • 8392 replies
  • 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+20
  • Author
  • Enthusiast
  • 154 replies
  • 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.

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
  • 8392 replies
  • January 27, 2020

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