3 Replies Latest reply on Aug 17, 2009 4:46 AM by tony@greenwich

    Trying to retrieve a database sequence number using HTTPService


      I am trying to return a sequence number from a database and assign it to a variable 'recordID'.

      When I call the function getNextRecordID using a button the next sequence number is returned ok.

      The problem is that each subsequent call to this function returns the same number. Only when I close

      and reopen the application does it change.


      Any ideas?



      private var recordID:String;


      private function httpResult(event:ResultEvent):void


           recordID = '';

           recordID = event.result.root.sequence.seq;  //sequence.seq is returned from database via xml



      private function getNextRecordID():void


           var getRecordID:HTTPService = new HTTPService();

           getRecordID.url = http://........../getNextSeqNo; //call to oracle database procedure

           getRecordID.addEventListener("result", httpResult);