Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 'WHERE' CLAUSE IN INSERT STATEMENT PROBLEM 1

Status
Not open for further replies.

kingjjx

Programmer
Sep 18, 2001
181
US
When I have this in my ACTION/INSERT page to insert data
can I use WHERE in my INSERT statement ?

<CFLOOP from=1 to=5 index=&quot;loopcount&quot;>
<CFSET currF=&quot;fname#loopcount#&quot;>
<CFSET currL=&quot;lname#loopcount#&quot;>
<Cfquery name=&quot;addjcode&quot; datasource=&quot;Timesheets&quot;>
Insert into Jobcodes (Fname, Lname)
VALUES('#evaluate(currF)#', '#evaluate(currL)#')
</cfquery>
</CFLOOP>

I would like to say WHERE PRIKEY=1
but its not letting me do it ...
please help !!
'
thanks
 
If you are saying &quot;WHERE PRIKEY=1&quot;, that means there is data in the table already. Why are you using insert instead of update?

FTK
 
hey... thanks ... i've been thinking too much today ... completely wrong logic on my part ... the update function is what I needed.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top