Data Exhausted error in IronPython script
sbendayan
Posts: 18 Bronze 1
Greetings,
I am trying to populate a complex FK scenario with the Python script below and am getting the error 'Data exhausted for field 'TenantId''.
Can anyone tell me what I'm doing wrong?
def main(config):
import System.Data.SqlClient
connection = System.Data.SqlClient.SqlConnection(config["connection_string"])
command = System.Data.SqlClient.SqlCommand("SELECT Top 1 LegalEntityCompanyId FROM dbo.Companies WHERE TenantId = '" + TenantId + "'", connection)
connection.Open()
value = command.ExecuteScalar()
connection.Close()
return value
I am trying to populate a complex FK scenario with the Python script below and am getting the error 'Data exhausted for field 'TenantId''.
Can anyone tell me what I'm doing wrong?
def main(config):
import System.Data.SqlClient
connection = System.Data.SqlClient.SqlConnection(config["connection_string"])
command = System.Data.SqlClient.SqlCommand("SELECT Top 1 LegalEntityCompanyId FROM dbo.Companies WHERE TenantId = '" + TenantId + "'", connection)
connection.Open()
value = command.ExecuteScalar()
connection.Close()
return value
Comments
Sorry to say, I am not an expert in Python scripting.
Do any of the following articles help:
http://stackoverflow.com/questions/3727 ... ualization
https://ironpython-test.readthedocs.io/ ... tools.html
https://community.tibco.com/questions/i ... hon-script
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com