title: "Union" Multiple Select Query in Oracle Stored Procedure
body: <p>I trying to "Union" multiple select statements in below Stored Procedure</p>
  
  <pre><code>Create or replace PROCEDURE procedure1
  as
  BEGIN
  SELECT b.EntityName,
       c.StateLaneName,
                c.ConsiderEntityOwnership,
                a.InitialState,
       d.StateName,
       e.EventName,
       1              AS Discriminator,     
       NULL               AS TransitionSeq,
       NULL               AS TransitionName,
       k.WorkflowActionSeq        AS ActionSeq,
       l.ActionName           AS ActionName,
       l.ClassPath            AS ClassPath,
       NULL               AS MessageKey,
       NULL               AS NextStateName
  
     FROM Workflow a,
       Entity b,
       WorkflowStateLane c,
       WorkflowState d,
       WorkflowEvent e,
       WorkflowEventAction k,
       WorkflowAction l
  
  WHERE a.WorkflowEntityId        = b.EntityId
        AND a.WorkflowStateLaneId     = c.WorkflowStateLaneId
        AND a.WorkflowStateId     = d.WorkflowStateId
        AND a.WorkflowEventId     = e.WorkflowEventId
        AND a.WorkflowId          = k.WorkflowId
        AND k.WorkflowActionId        = l.WorkflowActionId
        AND k.TransitionActionType        = 1
  
  UNION
  
  (SELECT b.EntityName,
       c.StateLaneName,
                c.ConsiderEntityOwnership,
                a.InitialState,
       d.StateName,
       e.EventName,
       2              AS Discriminator,    
       NULL               AS TransitionSeq,
       NULL               AS TransitionName,
       k.WorkflowActionSeq        AS ActionSeq,
       l.ActionName           AS ActionName,
       l.ClassPath            AS ClassPath,
       NULL               AS MessageKey,
       NULL               AS NextStateName
  
     FROM Workflow a,
       Entity b,
       WorkflowStateLane c,
       WorkflowState d,
       WorkflowEvent e,
       WorkflowEventAction k,
       WorkflowAction l
  
  WHERE a.WorkflowEntityId        = b.EntityId
        AND a.WorkflowStateLaneId     = c.WorkflowStateLaneId
        AND a.WorkflowStateId     = d.WorkflowStateId
        AND a.WorkflowEventId     = e.WorkflowEventId
        AND a.WorkflowId          = k.WorkflowId
        AND k.WorkflowActionId        = l.WorkflowActionId
        AND k.TransitionActionType        = 2);
  END proceure1;
  </code></pre>
  
  <p>When I compile I'm getting an error
  PLS-00428: an INTO clause is expected in this select function.
  I'm newbie in Oracle. Please help me.</p>