Quantcast

ORA-00923: FROM keyword not found where expected

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

ORA-00923: FROM keyword not found where expected

Trenton D. Adams
I cannot identify this.  I have other collections that seem to work
just fine, not sure why this one just won't work.  The queries work by
themselves.  The one with the collection in it works fine if I comment
it out.

org.springframework.jdbc.BadSqlGrammarException:
### Error querying database.  Cause: java.sql.SQLException: ORA-00923:
FROM keyword not found where expected
### The error may involve
com.example.midtier.dbaccess.ExamRequestMapper.examinventory-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: ORA-00923: FROM keyword not found
where expected


In one resultMap, I have...

    <collection property="examDetails" javaType="List"
                column="syrexin_id" ofType="ExamDetailsRecord"
                select="examdetails"/>


And then I have...
  <resultMap id="EXDTResult"
             type="com.example.ExamDetailsRecord">
    <result property="code" column="syvervv_value" />
    <result property="count" column="syrexdt_count" />
    <result property="comments" column="syrexdt_comments" />
  </resultMap>

  <select id="examdetails" parameterType="int" resultMap="EXDTResult">
  SELECT syrexdt_exin_id,
         syrexdt_count,
         syrexdt_comments,
         syvervv_value
    FROM syrexdt,
         syvervv
   WHERE syrexdt_exin_id = #{syrexin_id}
     AND syrexdt_code    = syvervv_code
  </select>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ORA-00923: FROM keyword not found where expected

Eduardo Macarron
First, turn the log on and check that the failing query is the one you
are expecting.

On 28 feb, 01:36, Trenton <[hidden email]> wrote:

> I cannot identify this.  I have other collections that seem to work
> just fine, not sure why this one just won't work.  The queries work by
> themselves.  The one with the collection in it works fine if I comment
> it out.
>
> org.springframework.jdbc.BadSqlGrammarException:
> ### Error querying database.  Cause: java.sql.SQLException: ORA-00923:
> FROM keyword not found where expected
> ### The error may involve
> com.example.midtier.dbaccess.ExamRequestMapper.examinventory-Inline
> ### The error occurred while setting parameters
> ### Cause: java.sql.SQLException: ORA-00923: FROM keyword not found
> where expected
>
> In one resultMap, I have...
>
>     <collection property="examDetails" javaType="List"
>                 column="syrexin_id" ofType="ExamDetailsRecord"
>                 select="examdetails"/>
>
> And then I have...
>   <resultMap id="EXDTResult"
>              type="com.example.ExamDetailsRecord">
>     <result property="code" column="syvervv_value" />
>     <result property="count" column="syrexdt_count" />
>     <result property="comments" column="syrexdt_comments" />
>   </resultMap>
>
>   <select id="examdetails" parameterType="int" resultMap="EXDTResult">
>   SELECT syrexdt_exin_id,
>          syrexdt_count,
>          syrexdt_comments,
>          syvervv_value
>     FROM syrexdt,
>          syvervv
>    WHERE syrexdt_exin_id = #{syrexin_id}
>      AND syrexdt_code    = syvervv_code
>   </select>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ORA-00923: FROM keyword not found where expected

Trenton D. Adams
Yeah, it was already set to DEBUG mode, and the query in question did
not come out in the logs, or at least anything related to what I was
expecting didn't.  I'll look at it again tomorrow.

On Mon, Feb 27, 2012 at 9:36 PM, Eduardo <[hidden email]> wrote:

> First, turn the log on and check that the failing query is the one you
> are expecting.
>
> On 28 feb, 01:36, Trenton <[hidden email]> wrote:
>> I cannot identify this.  I have other collections that seem to work
>> just fine, not sure why this one just won't work.  The queries work by
>> themselves.  The one with the collection in it works fine if I comment
>> it out.
>>
>> org.springframework.jdbc.BadSqlGrammarException:
>> ### Error querying database.  Cause: java.sql.SQLException: ORA-00923:
>> FROM keyword not found where expected
>> ### The error may involve
>> com.example.midtier.dbaccess.ExamRequestMapper.examinventory-Inline
>> ### The error occurred while setting parameters
>> ### Cause: java.sql.SQLException: ORA-00923: FROM keyword not found
>> where expected
>>
>> In one resultMap, I have...
>>
>>     <collection property="examDetails" javaType="List"
>>                 column="syrexin_id" ofType="ExamDetailsRecord"
>>                 select="examdetails"/>
>>
>> And then I have...
>>   <resultMap id="EXDTResult"
>>              type="com.example.ExamDetailsRecord">
>>     <result property="code" column="syvervv_value" />
>>     <result property="count" column="syrexdt_count" />
>>     <result property="comments" column="syrexdt_comments" />
>>   </resultMap>
>>
>>   <select id="examdetails" parameterType="int" resultMap="EXDTResult">
>>   SELECT syrexdt_exin_id,
>>          syrexdt_count,
>>          syrexdt_comments,
>>          syvervv_value
>>     FROM syrexdt,
>>          syvervv
>>    WHERE syrexdt_exin_id = #{syrexin_id}
>>      AND syrexdt_code    = syvervv_code
>>   </select>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ORA-00923: FROM keyword not found where expected

Trenton D. Adams
The only thing I added to the query was a decode, with a label of
'online'.  So, considering it was such a simple change, I did not
think for a moment it was causing issues.  Apparently "online" is
reserved for some purpose, and none of my tools knew that.  So, after
pasting into an SQL editor/query tool, it showed me where the error
is.

Sorry for the bother.

On Mon, Feb 27, 2012 at 9:39 PM, Trenton D. Adams
<[hidden email]> wrote:

> Yeah, it was already set to DEBUG mode, and the query in question did
> not come out in the logs, or at least anything related to what I was
> expecting didn't.  I'll look at it again tomorrow.
>
> On Mon, Feb 27, 2012 at 9:36 PM, Eduardo <[hidden email]> wrote:
>> First, turn the log on and check that the failing query is the one you
>> are expecting.
>>
>> On 28 feb, 01:36, Trenton <[hidden email]> wrote:
>>> I cannot identify this.  I have other collections that seem to work
>>> just fine, not sure why this one just won't work.  The queries work by
>>> themselves.  The one with the collection in it works fine if I comment
>>> it out.
>>>
>>> org.springframework.jdbc.BadSqlGrammarException:
>>> ### Error querying database.  Cause: java.sql.SQLException: ORA-00923:
>>> FROM keyword not found where expected
>>> ### The error may involve
>>> com.example.midtier.dbaccess.ExamRequestMapper.examinventory-Inline
>>> ### The error occurred while setting parameters
>>> ### Cause: java.sql.SQLException: ORA-00923: FROM keyword not found
>>> where expected
>>>
>>> In one resultMap, I have...
>>>
>>>     <collection property="examDetails" javaType="List"
>>>                 column="syrexin_id" ofType="ExamDetailsRecord"
>>>                 select="examdetails"/>
>>>
>>> And then I have...
>>>   <resultMap id="EXDTResult"
>>>              type="com.example.ExamDetailsRecord">
>>>     <result property="code" column="syvervv_value" />
>>>     <result property="count" column="syrexdt_count" />
>>>     <result property="comments" column="syrexdt_comments" />
>>>   </resultMap>
>>>
>>>   <select id="examdetails" parameterType="int" resultMap="EXDTResult">
>>>   SELECT syrexdt_exin_id,
>>>          syrexdt_count,
>>>          syrexdt_comments,
>>>          syvervv_value
>>>     FROM syrexdt,
>>>          syvervv
>>>    WHERE syrexdt_exin_id = #{syrexin_id}
>>>      AND syrexdt_code    = syvervv_code
>>>   </select>
Loading...