From: JohnGree on
Hi i have a sheduled task every 60 seconds which works like this

1. finds email from my specified account
2. gets info from the body of the email
3. if email info matches info already in my database ie username password,
then send SMS out.
4. insert info into records table.
5 delete email

that is basicly the process.

the issue i sometimes get is, if there is a problem with the insert query
(very rairly but happens), then the email does not get deleted. so every 60
seconds the sms is sent out, again and again and again.


so i was thinking can i do this.

1. finds email from my specified account
2. gets info from the body of the email
3. if email info matches info already in my database ie username password,
insert info into records table.

4.if insert was successful then send sms and delete the email
5. if the insert was NOT successful delete email anyway.


but what would be the code to find out if the insert query was successful or
not?


Many thanks

John

From: jdeline on
You could query the database to see if the record is there.
From: JohnGree on
ok thanks, but what would be the query to select the last record in the table

<cfquery datasource="#application.ds#">
SELECT *
FROM SMS_Records
WHERE ID =
</cfquery>
From: [CJ] on
[Q]what would be the query to select the last record in the table[/Q]

depends on your database.
From: "JR "Bob" Dobbs" on
See if this link helps.
http://www.forta.com/blog/index.cfm/2006/12/8/Getting-RECORDCOUNT-For-INSERT-UPDATE-DELETE-Operations