GO
SET ANSI_NULLS ON
GO
@job_name = @P_Job_Name,
@job_aspect = 'Job'
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
procedure="sp_Job_Status"
datasource="#Application.DSN#"
username="#Application.DSNUser#"
password="#Application.DSNPWD#">
<cfprocparam
type="In"
cfsqltype="CF_SQL_VARCHAR"
dbvarname="@P_Job_Name"
value="#Job_Name#"
null="No">
<cfprocresult
name="qry_job_status">
</cfstoredproc>
<cfset SessVar = "session."& "#Job_Name#">
<cfset "session.#Job_Name#" = "Unknown">
</cfif>
<!--- List the Job status information --->
<cfinclude template="/cf_tools/query/qry_Job_Status.cfm">
<cfif qry_job_status.last_run_date neq "" AND Len(qry_job_status.last_run_date) eq 8>
<!--- Convert the last run date into a date parameter --->
<cfset LastDate =
CreateDate (MID(qry_job_status.last_run_date,1,4),
MID(qry_job_status.last_run_date,5,2),
MID(qry_job_status.last_run_date,7,2))>
</cfif>
<cfset Temp = Job_Name
<!--- If the job is not currently running --->
<cfif TRIM(qry_job_status.current_execution_step) eq "0 (unknown)">
<cfoutput>
<cfif DateFormat(LastDate,"DDMMYYYY") eq DATEFORMAT(NOW(),"DDMMYYYY")>
<FONT COLOR="Navy">
<cfelse>
<font Color=Black>
</cfif>
<!--- Display appropriate message based on Jobs last outcome --->
<cfswitch _expression_="#qry_job_status.last_run_outcome#">
<cfcase value="0">
<cfif evaluate(#SessVar#) eq "Running"> <!--- The last status was "running" --->
<script>
<!--
self.focus()
alert("A Job Failed")
//-->
</script>
</cfif>
Last Ran #DateFormat(LastDate,"dd/mmm/yyyy")# Failed
</cfcase>
<cfcase value="1">
<cfif evaluate(#SessVar#) eq "Running">
<cfset "#SessVar#" = "Succeeded">
<script>
<!--
self.focus()
alert("A Job finished Successfully")
//-->
</script>
</cfif>
Last Ran #DateFormat(LastDate,"dd/mmm/yyyy")# Succeeded
</cfcase>
<cfcase value="3">
<cfif evaluate(#SessVar#) eq "Running">
<cfset "#SessVar#" = "Cancelled">
<script>
<!--
alert("A Job Was Cancelled")
//-->
</script>
</cfif>
Last Ran #DateFormat(LastDate,"dd/mmm/yyyy")# Cancelled By User
</cfcase>
<cfDefaultCase>
Unknown
</cfdefaultcase>
</cfswitch>
</font>
</cfoutput>
<cfelse>
<!--- Display a running message --->
<cfset "session.#Job_Name#" = "Running">
<cfoutput><Font color="RED">Running...</FONT></cfoutput>
</cfif>
--------Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Taco Fleur
Sent: Wednesday, 21 January 2004 8:38 AM
To: CFAussie Mailing List
Subject: [cfaussie] CF to quick!I have a process that goes as follows:
1. Copy template file (xls or mdb) to new file name
2. Run DTS package via cfexecute
3. DTS exports records to the new file we copied in step 1
4. The user downloads the file or has it send to him via emailWhen the user clicks export a link to the file appears, but the export is not finished.
What do you reckon is the best way of handling this?
1. I can check if the file exists, but then I'd first have to move it away from where I store it now, and have DTS to do the actual moving of the file, most likely I will have to copy it (due to locking issues) which brings along other work.
2. Your brilliant idea!
Taco Fleur
---
07 3535 5072
Blog: http://www.tacofleur.com/index/blog/
Methodology: http://www.tacofleur.com/index/methodology/
Tell me and I will forget
Show me and I will remember
Teach me and I will learn
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
