0

Oracle Version: 10g.

in my Mapper.xml

<insert id="insert" useGeneratedKeys="true">
<selectKey keyProperty="id" resultType="int" order="BEFORE">
       SELECT AUTO_INCR.nextVal from dual;
</selectKey>
INSERT INTO TABLE1(id,email,subject)
VALUES(#{id},#{email},#{subject})
</insert>

My table structure in oracle:

id PK NUMBER

email Varchar2

subject Varchar2

I also have a sequence created named:AUTO_INCR

But this returns me with a error: ORA-0091 invalid Character

i called it at my page by:

http.post({
     method: 'POST',
     url: 'myurl',  
     data: {
       email: email,
       subject : subject
}
})

Any idea how to carry on ?? I tried to research on the error but to no avail , i couldn't solve it.

John Tan
  • 65
  • 9
  • "But this returns me with a error: ORA-0091 invalid Character". Which code or something are you referring using 'this' ? Did you mean the code inside mapper.xml? – atokpas Feb 02 '17 at 10:30
  • i call it with http.post at my other pages in order to insert a data into oracle db – John Tan Feb 02 '17 at 10:34
  • Try again removing `;` from `from dual;`. And the previous edit was more readable and you just reverted it. – atokpas Feb 02 '17 at 10:35
  • i tried removing the ; . it works for the first insert. But the subsequent insert was not successful because the ID did not increment. What can i do to increment the id ? @JSapkota – John Tan Feb 03 '17 at 02:00

0 Answers0