SQL Developer: missing expression on insert into with select rownum

10 pts.
Tags:
ORA-00936
Oracle development
SQL development
insert into TEMPLE_BDMS.TEMP_QSP values ( select rownum as uniqrownum, doc_id, doc_type, barcode2, barcode3, barcode4, routing_status, scan_date, assignee, scanner, scan_station, pfile_name, new_doc_id, new_doc_type, new_doc_type2 from TEMPLE_BDMS.QSP_SOURCE where pfile_name not like '%_0001.%' )

I can run the select fine (it returns rows), but when I try to insert with the select, I get an ORA-00936 missing expression error.



Software/Hardware used:
sqldeveloper 1.5.4 on windows XP

Answer Wiki

Thanks. We'll let you know when a new response is added.

When inserting from a query, you don’t have to use the VALUES clause.

Your statement should look like this:

<pre>insert into TEMPLE_BDMS.TEMP_QSP select rownum as uniqrownum, doc_id, doc_type, barcode2, barcode3, barcode4, routing_status, scan_date, assignee, scanner, scan_station, pfile_name, new_doc_id, new_doc_type, new_doc_type2
from TEMPLE_BDMS.QSP_SOURCE
where pfile_name not like ‘%_0001.%’ ;</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following