/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2012 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
SET SCAN OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE

  --
  -- Local constants and variables
  --
  l_sql varchar2(32000);

BEGIN

  --
  -- Register QueryTimecardPeriodDates service
  --
  l_sql :=
'        SELECT  to_date(:pStartDate)  + rownum -1 actual_date
               ,to_char(to_date(:pStartDate) + rownum -1, ''FMddth'') short_name
               ,to_char(to_date(:pStartDate) + rownum -1, ''FMDy ddth'') medium_name
               ,to_char(to_date(:pStartDate) + rownum -1, ''FMDay ddth'') long_name
               ,to_char(to_date(:pStartDate) + rownum -1, ''FMDay ddth Month YYYY'') full_name
        FROM    dual
        CONNECT BY rownum &lt; to_date(:pEndDate) - to_date(:pStartDate) + 1 ';

  xxas_com_sr_pkg.seed_query_service
    (p_service_name      => 'QueryTimecardPeriodDates'
    ,p_securing_function => 'XXAS_SRV_Q_TCM_TC_DATES_PERM'
    ,p_sql               => l_sql
    ,p_parameters        => xxas_com_sr_param_varray
                              (xxas_com_sr_param_type('pStartDate' , xxas_com_sr_pkg.g_DATE)
                              ,xxas_com_sr_param_type('pEndDate'   , xxas_com_sr_pkg.g_DATE)));

END;
/
COMMIT;
EXIT;
