Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Merge with subquery causes ORA-38101 Invalid column in the INSERT VALUES C

Started 1 month, 1 week ago by Abc123Xyz
The following is a somewhat shortened version of an SQL statement that is causing the error. MERGE INTO applicant_matches m_table USING ( SELECT DISTINCT s.student_id, a.term_scope_id, a.first_name, a.last_name, a.ssn_visa, a.birth_date, ... ) m_list ON (m_list.student_id = m_table.student_id ...
Site: www.oracle.com  www.oracle.com - site profile
Forum: SQL and PL/SQL   SQL and PL/SQL
 - forum profile
Total authors: 4 authors
Total thread posts: 10 posts
Thread activity: no new posts during last week
Domain info for: oracle.com

Other posts in this thread:

Tubby replied 1 month, 1 week ago
If your query returns a single value (which it seems to since your example doesn't like that record to anything in the table you're merging in to or the data you are using to perform the merge) why wouldn't you just select that in to a variable outside the MERGE statement? SELECT ts.VALUE INTO l_variable FROM term_scope ts JOIN campus_term ct ...

user142857 replied 1 month, 1 week ago
If you change the subquery so that the last condition is specified in the JOIN rather than in the WHERE, does it work? SELECT 'A' FROM term_scope ts JOIN campus_term ct ON ts.campus_term_id=ct.campus_term_id AND ts.term_scope_id = 5

Abc123Xyz replied 1 month, 1 week ago
Thanks. I tried to simplify to figure out what was going on because I was wondering if it wouldn't let you do a subquery with a value you were merging with, so I just wanted to rule that out. Originally it looked more like this: MERGE INTO applicant_matches m_table USING ( SELECT DISTINCT s.student_id, a.term_scope_id, a....

user142857 replied 1 month, 1 week ago
just doing some local tests here, it doesn't like the condition when specified as part of the WHERE clause. It works if the condition is made part of the JOIN. It does work if you use the old Oracle join syntax: SELECT 'A' FROM term_scope ts, campus_term ct WHERE ts.campus_term_id=ct.campus_term_id AND ts.term_scope_id = m_list.term_...

Abc123Xyz replied 1 month, 1 week ago
user142857, that works with the constant, but then when I try to change it back to (SELECT 'P' FROM watch_term_scope ts JOIN watch_campus_term ct ON ts.campus_term_id=ct.campus_term_id AND ts.term_scope_id = m_list.term_scope_id ) I get: SQL Error: ORA-00904: "M_LIST"."TERM_SCOPE_ID": invalid identifier In the...

user142857 replied 1 month, 1 week ago
try it using the old join syntax select 'x' from t1, t2 where t1.col = t2.col and t2.other_col = using_set.other_col

Abc123Xyz replied 1 month, 1 week ago
well, that seems to work.

user142857 replied 1 month, 1 week ago
Seems like a good candidate for a bug report.

user12194376 replied 1 month, 1 week ago
Emicsoft WMV Converter for Mac is devoted to converting video formats like MPEG, MOV, AVI, MP4, FLV, 3GP and other video formats to WMV Mac, apart from multiple input formats supported, you are allowed to convert WMV to other formats on Mac OS X. Not only video files conversion supported, the WMV Converter Mac also supports extracting audio track from WMV ...

 

Top contributing authors

Name
Posts
user142857
4
user's latest post:
Merge with subquery causes...
Published (2009-11-09 12:50:00)
Seems like a good candidate for a bug report.
Abc123Xyz
4
user's latest post:
Merge with subquery causes...
Published (2009-11-09 12:49:00)
well, that seems to work.
Tubby
1
user's latest post:
Merge with subquery causes...
Published (2009-11-09 12:14:00)
If your query returns a single value (which it seems to since your example doesn't like that record to anything in the table you're merging in to or the data you are using to perform the merge) why wouldn't you just select that in to a variable outside the MERGE statement? SELECT ts.VALUE INTO l_variable FROM term_scope ts JOIN campus_term ct ON ts.campus_term_id=ct.campus_term_id WHERE ts.term_scope_id = 5 and then MERGE MERGE...
user12194376
1
user's latest post:
Merge with subquery causes...
Published (2009-11-09 21:29:00)
Emicsoft WMV Converter for Mac is devoted to converting video formats like MPEG, MOV, AVI, MP4, FLV, 3GP and other video formats to WMV Mac, apart from multiple input formats supported, you are allowed to convert WMV to other formats on Mac OS X. Not only video files conversion supported, the WMV Converter Mac also supports extracting audio track from WMV video to MP3, WMA, WAV, AAC, AC3, OGG, etc. Moreover, all converted files can be played...

Related threads on "www.oracle.com":

Related threads on other sites:

Thread profile page for "Merge with subquery causes ORA-38101 Invalid column in the INSERT VALUES C" on http://www.oracle.com. This report page is a snippet summary view from a single thread "Merge with subquery causes ORA-38101 Invalid column in the INSERT VALUES C", located on the Message Board at http://www.oracle.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity