|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
CFINSERT and CFUPDATE are two CFML tags that should never have been made. They were trying to make it "easy" for non-programmers but all the really did was create more confusion. Just use CFQUERY and write your own INSERT or UPDATE statements.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Cfupdate Cfinsert |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|