1 Reply Latest reply: Apr 6, 2013 2:40 AM by Kiran V RSS

    Dealing with errors from a webservice

      Hi all,


      I am trying to construct a webservice load statement using a http request string that returns either a csv table or xml. Due to the large amounts of data that is being returned, the server is timing out and the load is failing.


      However in the api call I can input a date range - so I decided to try running the query using a series of incremental 2 week periods. This works fine when there is data present,limiting the data returned to more managebale chunks, but when there is no data for the time period the server returns a no data present error and the load freezes.


      Is there a way of dealing with this error?  Maybe like a time out to push on to cancel the http call and then move on to the next?


      Heres my code - you can see I tried the set ErroroMode, but thats not helping.


      Any help gratefully recieved.






      set ErrorMode  =0;

      // Create initial table to load data to


      LOAD *,

      Date#('2013-03-19', 'YYYY-MM-DD') as Date_Extracted



      txt, codepage is 1252, embedded labels, delimiter is ',', msq);

      //Set start load date and number of iterations

      let Date1= Num(Date#('2012-09-21', 'YYYY-MM-DD'));

      let weeks = 12;

      //Start looping

      for i=0 to $(weeks)

      //Amend date variable with iteration

      let date1= $(Date1) + 28*$(i);

      let date2= $(date1) + 28;

      // format date variable to work in http call

      let date4=Date($(date1));

      let date5=Date($(date2));

      //load next iteration

      Concatenate (DATA_TABLE) LOAD *,

      $(date4) &'-'& $(date5) as Date_range



      txt, codepage is 1252, embedded labels, delimiter is ',', msq);

      //end loop


      //Store to qvd

      STORE * from DATA_TABLE into DATA_TABLE.qvd;