Goanywhere FTP Uploaded Trigger Insert to SQL DB
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
3 posts
Page 1 of 1
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
This is a utility I created several years back... it should do what you're looking for.
Code: Select all
<project name="Write File Stats"
mainModule="Main"
version="2.0"
logLevel="silent">
<variable name="trg_filename"
value="" />
<variable name="trg_filesize"
value="" />
<variable name="trg_filetype"
value="" />
<variable name="trg_lastmod"
value="" />
<variable name="trg_trantype"
value="" />
<variable name="trg_projname"
value="" />
<variable name="trg_jobid"
value="" />
<variable name="trg_begtime"
value="" />
<variable name="trg_endtime"
value="" />
<module name="Main">
<print label="(Status) Error Specs"
version="1.0">
<![CDATA[
================================================================================
** JobLog **
Placing data into ${ LogFile } on ${ Server } Resource
================================================================================
filename ${ trg_filename }
filesize ${ trg_filesize }
filetype ${ trg_filetype }
lastmod ${ trg_lastmod }
trantype ${ trg_trantype }
projname ${ trg_projname }
jobid ${ trg_jobid }
begtime ${ trg_begtime }
endtime ${ trg_endtime }
================================================================================
]]>
</print>
<setVariable label="Init sqlERROR"
name="sqlERROR"
value="0"
version="1.0" />
<sql label="Connect to Server"
resourceId="${Server}"
version="1.0"
onError="setVariable:sqlERROR=1">
<query label="Put Log Rec">
<statement>
Insert into ${ LogFile }
( filename, filesize, filetype, lastmod, trantype, projname, jobid, begtime, endtime )
Values ( '${ trg_filename }',
${ trg_filesize } ,
'${ trg_filetype }',
'${ trg_lastmod }',
'${ trg_trantype }',
'${ trg_projname }',
'${ trg_jobid }',
'${ trg_begtime }',
'${ trg_endtime }' )
</statement>
</query>
</sql>
<if label="Error Inserting Data?"
condition="${ sqlERROR gt 0 }">
<print label="SQL Insert Error?"
version="1.0">
<![CDATA[
================================================================================
** JobLog Error **
Error Placing data into ${ LogFile } on ${ Server } Resource
================================================================================
]]>
</print>
</if>
</module>
<variable name="Server"
value="Stats DB"
description="Log Server ResourceID" />
<variable name="LogFile"
value="[dbo].filestats"
description="Log Table" />
<description>Write entry to File Stats Database in GoA_Stats DB</description>
</project>
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
3 posts
Page 1 of 1