/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2010 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 Query Recent Tags
  --
  l_sql :=
'        SELECT DISTINCT *
        FROM (SELECT tc.tag_id
                    ,tc.tag
              FROM   xxas_com_tags t
                    ,xxas_com_tag_cloud tc
              WHERE  t.tag_id = tc.tag_id
              AND    t.entity_name = ''PERSON''
              ORDER BY t.last_update_date desc) ';

  xxas_com_sr_pkg.seed_query_service
    (p_service_name      => 'QueryRecentTags'
    ,p_securing_function => 'XXAS_SRV_Q_RECENT_TAGS_PERM'
    ,p_sql               => l_sql
    ,p_page_size         => 30);

END;
/
COMMIT;
EXIT;
