Back to forum list… Back to How Do I?...

Script Task to invoke Stored Procedure throws error (No replies)

Arline Welty
1 year ago
Arline Welty 1 year ago

Is it disallowed to execute a stored procedure via Script Task?
Or is it disallowed to have a Script Task as the last transform in an Iman job?

I have a job with 2 script tasks; one is working fine in the middle of the job, but the one I am attempting to add as the last step in a job is failing. 

Failure message in Errors.txt:

2022-12-27 13:45:52:926 - Realisable.Data.Transform.IOC.IoCLoadException: Error loading transform [Script_2].
Error - at Line [0] Position [0]
at Realisable.Data.Transform.IOC.TransformControllerFactory.Get(TransformTypes transformType, TransformDefinition inputDefinition, TransactionFactory transactionFactory, Boolean designMode)
at Realisable.Data.Transform.TransformCoordinator.RunTransform(TransactionFactory factory, TransformDefinition inputDefinition)
at Realisable.Data.Transform.TransformCoordinator.RunTransformStream(TransformDefinition tfmDef, TransactionFactory parentFactory)
at Realisable.Data.Transform.TransformCoordinator.Process()
at Realisable.IntManEng.Program.Main(String[] args)

 

Actual contents of Script task:

</p>
<p>'Set this to a file path to your SQL script.<br />Const SCRIPT_FILE = "E:\IMan\SQLScripts\GET\spIMan_TSTEDI_GET830_SCR2.sql"<br />'This is our connection string:</p>
<p>Const DB_CONNECTION = "Driver={SQL Server Native Client 11.0};Server=XXXXX;Database=XXXXX;Uid=XXX;Pwd=XXXX;"</p>
<p>Dim con<br />Dim cmd<br />Dim fso<br />Dim ts<br />Dim sScript</p>
<p>Set fso = CreateObject("Scripting.FileSystemObject")<br />Set ts = fso.OpenTextFile(SCRIPT_FILE, 1, False)<br />sScript = ts.ReadAll<br />ts.Close</p>
<p>Set con = CreateObject("ADODB.Connection")<br />con.Open DB_CONNECTION</p>
<p>Set cmd = CreateObject("ADODB.Command")<br />cmd.CommandText = sScript<br />cmd.ActiveConnection = con<br />cmd.Execute<br />Set cmd = Nothing<br />con.Close<br />""</p>
<p> </p>
<p>

 

 

I've double checked the connection string, I've confirmed I can run the statement when I individually refresh the script task, but whenever the script task is invoked via the scheduler, it fails. I've even changed the .sql file to be a simple "select" statement and it still fails, so I don't necessarily think it is related to the stored procedure. 

Thanks for any advice,

Arline

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close