Hi all,

I'm using a data service and I want to get the last inserted id of a auto
incremented column from the database. After executing the insert query, I
call a get resource that execute the following query in the data service
server.

<query id="get_last_inserted_id" useConfig="default">
      <sql>SELECT LAST_INSERT_ID() AS LAST_INSERTED_ID</sql>
      <result element="WSO2_QAP_FEATURECollection"
rowName="WSO2_QAP_FEATURE">
         <element column="LAST_INSERTED_ID" name="LAST_INSERTED_ID"
xsdType="xs:integer"/>
      </result>
   </query>

Sometimes I get the correct id and sometimes I get "0" as the last inserted
id. Can someone help me to resolve this problem or any other workaround to
get the last inserted id.

Regards
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to