
February 14th, 2004, 11:41 AM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 7
Time spent in forums: 5 m 50 sec
Reputation Power: 0
|
|
|
Cfupdate Cfinsert
I am having problems using <CFUPDATE> with the following update/insert. The problem is that I can't use the where= in the CFUPDATE tag as I do in the regular SQL (see below). Is there a way to do this with CFINSERT and CFUPDATE Here is my code.
I need it to work with CF tags because of date field issues. ANY suggestions are appriciated.
-------------------------------------------------
<CFQUERY NAME="checkval" DATASOURCE="cisdata">
SELECT a.ID, b.ameriapp_id
FROM ameriadmin b RIGHT OUTER JOIN
ameriapp a ON a.ID = b.ameriapp_id
WHERE a.ID = #listing__ID#
</CFQUERY>
<cfoutput query="checkval">
<cfif ameriapp_id NEQ ID>
<cfquery datasource="cisdata">
insert into ameriadmin
( ameriapp_id,notes,whatnextnotice)
values (#ID#,'#notes#','#whatnextnotice#' )
</cfquery>
<cfelse>
<cfquery datasource="cisdata">
update ameriadmin
set notes='#notes#',
whatnextnotice='#whatnextnotice#',
WHERE ameriapp_id = #listing__ID#
</cfquery>
</cfif>
</cfoutput>
------------------------------------
THANKS
|