Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLException: Invalid column index in database adapter

764615Aug 11 2010
I have a query that works fine if I run the sql in a JDeveloper SQL editor, but I get a "java.sql.SQLException: Invalid column index" error if I paste it in a database adapter. If I put this query in the adapter:
select <column>
  from <table>
   where <column> in (select
    trim( substr (txt,
          instr (txt, ',', 1, level  ) + 1,
          instr (txt, ',', 1, level+1)
             - instr (txt, ',', 1, level) -1 ) )
      as token
    from (select ','||#bindVariable||',' txt
            from dual)
  connect by level <=
     length(#bindVariable)-length(replace(#bindVariable,',',''))+1)
I get the error. But if I just put the sub query in the adapter as:
select
    trim( substr (txt,
          instr (txt, ',', 1, level  ) + 1,
          instr (txt, ',', 1, level+1)
             - instr (txt, ',', 1, level) -1 ) )
      as token
    from (select ','||#bindVariable||',' txt
            from dual)
  connect by level <=
     length(#bindVariable)-length(replace(#bindVariable,',',''))+1
the error goes away. Does anyone know what might be causing this?

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2010
Added on Aug 11 2010
0 comments
957 views