bsowards
asked on
Convert INSERT to UPDATE
Hi,
Could someone convert this to an UPDATE query please?
"INSERT into report (rp_title, rp_date, rp_desc, rp_category, rp_code, rp_link_page, rp_link_brochure, rp_link_subscribe, rp_year_start, rp_year_end, rp_n_america, rp_latin, rp_e_europe, rp_w_europe, rp_middle_east, rp_asia, rp_unpublished) values (?,?,?,?,?,?,?,?,?,?,?,?,? ,?,?,?,?); "
I'm using parameterized queries, and it will be WHERE rp_id = @rp_id
Thanks!
Could someone convert this to an UPDATE query please?
"INSERT into report (rp_title, rp_date, rp_desc, rp_category, rp_code, rp_link_page, rp_link_brochure, rp_link_subscribe, rp_year_start, rp_year_end, rp_n_america, rp_latin, rp_e_europe, rp_w_europe, rp_middle_east, rp_asia, rp_unpublished) values (?,?,?,?,?,?,?,?,?,?,?,?,?
I'm using parameterized queries, and it will be WHERE rp_id = @rp_id
Thanks!
"UPDATE into report set rp_title = ?, rp_date = ?, rp_desc= ?, rp_category= ?, rp_code= ?, rp_link_page= ?, rp_link_brochure= ?, rp_link_subscribe= ?, rp_year_start= ?, rp_year_end= ?, rp_n_america= ?, rp_latin= ?, rp_e_europe= ?, rp_w_europe= ?, rp_middle_east= ?, rp_asia= ?, rp_unpublished= ? where rp_id = ?;"
ASKER
should I put the rp_id parameter at the end or beginning of the list that follows? or doesn't it matter. i know it does in access
you have to put it at the end, in the order they appear in the sql statement.
ASKER
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'into'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'into'.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You don't need the "into" clause for an update statement, just "update report set..." In fact, I'm not sure it will work with it in there.
ASKER
thanx, worked like a charm