title: PL/SQL alias/variable to existing SQL query
body: <p>I am very new to PL/SQL and would like to be able to take advantage of the procedural options of oracle SQL. </p>
  
  <p>I have a query that I would like to transform into a PL/SQL query that takes the SKU you want and inputs whenever you have the word SKU in your query. </p>
  
  <p>Example: </p>
  
  <pre><code>SELECT A.*, CT.CUSTOMER_ID, CT.ORDERS
  FROM CUSTOMER_TABLE CT
  RIGHT JOIN
  (
  SELECT OT.COLUMN_ID, OT.SKU, OT.ORDERS
  FROM ORDERS_TABLE OT
  WHERE OT.SKU = 123
  )A
  ON CT.ORDERS = OT.ORDERS
  AND CT.SKU IS &gt; 0
  </code></pre>
  
  <p>This is strictly an example so I know that what I am asking is pointless, however, if I had a lengthier query that contains more than 2 or 3 "SKU" inputs then I would like to have a variable/parameter for it. </p>
  
  <p>My ideal code would be: </p>
  
  <pre><code>DECLARE
  SKUS INTEGER := 123;
  
  BEGIN
   SELECT A.*, CT.CUSTOMER_ID
      FROM CUSTOMER_TABLE CT
      RIGHT JOIN
      (
      SELECT OT.COLUMN_ID, OT.SKU, OT.ORDERS
      FROM ORDERS_TABLE OT
      WHERE @SKUS
      )A
      ON CT.ORDERS = OT.ORDERS
      AND @SKUS IS &gt; 0
  END;
  /
  </code></pre>
  
  <p>I am not sure if that is proper syntax but I hope the idea makes sense of what I am asking. </p>
  
  <p>Thank you!</p>