Can't import data from other tables via IronPython script

I am writing an IronPython script which reads data from other tables in the server using a SQL connection and query.

I am using the library found here to accomplish this:
http://www.ironpython.info/index.php?title=Accessing_SQL_Server

It has worked for the most part up until recently, with no issues other than timing out if the connection was slow. 

However, now it seems that something is going wrong when the SQL data is handled in Red Gate. Data that I read into IronPython using that SQL connection can be displayed properly in the preview data generation, but when I actually try to generate the data it fails with a "Can't insert empty sequence" error. 

The exact same code works perfectly in both PyCharm and Visual Studio; it only fails when the read-in SQL data is handled in a Red Gate IronPython generator for output to the server.

Has anyone else had this issue? Any advice is highly appreciated.
Tagged:

Answers

  • Alex BAlex B Posts: 1,158 Diamond 4
    Hi @mamiller,

    I have an open support ticket with you awaiting your reply.  If you are able to reply and provide the requested information either here or in that ticket I can proceed with the investigation.

    Please also include the latest copy of the python script and a screenshot of how you are using this in our tool!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • AvellaAvella Posts: 5 New member
    mamiller said:
    I am writing an IronPython script which reads data from other tables in the server using a SQL connection and query.

    I am using the library found here to accomplish this:
    http://www.ironpython.info/index.php?title=Accessing_SQL_Server

    It has worked for the most part up until recently, with no issues other than timing out if the connection was slow. 

    However, now it seems that something is going wrong when the SQL data is handled in Red Gate. Data that I read into IronPython using that SQL connection can be displayed properly in the preview data generation, but when I actually try to generate the data it fails with a "Can't insert empty sequence" error. 

    The exact same code works perfectly in both PyCharm and Visual Studio; it only fails when the read-in SQL data is handled in a Red Gate IronPython generator for output to the server.

    Has anyone else had this issue? Any advice is highly appreciated.
    I have the same issue.  My scenario is just doing a simple query against the other table with a join on the value for the current table, and for the most part works, but will error out with the same message about 50% way through the generation run every time.  I suspect there is some issue with connection management.  I've wrapped it in a try/except block with a default value, but no luck there.  The column is also nullable. 

    Has anyone identified a means to do logging and debug output during a run for better insights as to where the error lies?
Sign In or Register to comment.