Solved

Convert INSERT to UPDATE

Posted on 2006-11-28
7
339 Views
Last Modified: 2009-12-16
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!
0
Comment
Question by:bsowards
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18030884
"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 = ?;"
0
 

Author Comment

by:bsowards
ID: 18030888
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
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18030903
you have to put it at the end, in the order they appear in the sql statement.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:bsowards
ID: 18030936
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'into'.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 18031021
sorry, forgot to remove the keyword INTO:

"UPDATE 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 = ?;"
0
 
LVL 9

Expert Comment

by:danataylor
ID: 18031023
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.
0
 

Author Comment

by:bsowards
ID: 18031033
thanx, worked like a charm
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question