Advertisement
VoronVU

CONSTRUCTOR FUNCTION Obj$Campaign

Apr 8th, 2015
2,654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CONSTRUCTOR FUNCTION Obj$Campaign(id NUMBER DEFAULT NULL) RETURN SELF AS RESULT AS
  2. BEGIN
  3. IF id IS NULL THEN RETURN; END IF;
  4. WITH a AS (
  5.     SELECT cc.campaign_id,
  6.          cc.client_id,
  7.              cc.campaign_script,
  8.              cc.object_id,
  9.              cc.type_id,
  10.              cc.status_id,
  11.              oc.obj_code,
  12.              cc.campaign_code,
  13.              cc.campaign_begin,
  14.              cc.campaign_end,
  15.              cc.campaign_next,
  16.              cc.campaign_step,
  17.              oc.obj_title,
  18.              cb.node_id,
  19.              cb.item_id,
  20.              cb.channel_id
  21.       FROM   client_basket cb ,
  22.              client_campaign cc,
  23.              object_catalogue oc
  24.       WHERE  cc.object_id   = cb.item_id (+)
  25.       AND    cc.campaign_script = oc.obj_id (+)
  26.       AND    cc.campaign_id = id
  27.     )
  28.     SELECT a.campaign_id,
  29.            a.client_id,
  30.            a.campaign_script,
  31.            a.object_id,
  32.            a.type_id,
  33.            a.status_id,
  34.            a.obj_code,
  35.            a.campaign_code,
  36.            a.campaign_begin,
  37.            a.campaign_end,
  38.            a.campaign_next,
  39.            a.campaign_step,
  40.            a.obj_title,
  41.            a.node_id,
  42.            a.item_id,
  43.            a.channel_id,
  44.            NVL(c.node_code,'&'||'nbsp;'),
  45.            NVL(c.node_name,'&'||'nbsp;')
  46.     INTO   SELF.ID,
  47.            SELF.clientID,
  48.            SELF.scriptID,
  49.            SELF.objectID,
  50.            SELF.TYPE,
  51.            SELF.status,
  52.            SELF.scriptCode,
  53.            SELF.code,
  54.            SELF.startdate,
  55.            SELF.enddate,
  56.            SELF.nextdate,
  57.            SELF.state,
  58.            SELF.name,
  59.            SELF.itemNodeID,
  60.            SELF.itemID,
  61.            SELF.channelID,
  62.            SELF.itemCode,
  63.            SELF.itemName
  64.     FROM   a, catalogue c
  65.     WHERE  a.node_id = c.node_id (+);
  66.  
  67.     RETURN;
  68.   END Obj$Campaign;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement