Reference Guide > TDV SQL Script > SQL Script Examples > Example 5 (Pipe Variable)
 
Example 5 (Pipe Variable)
This example inserts the categories from the Northwind database into a PIPE variable.
PROCEDURE pipe_example2 (OUT param1 PIPE (col1 CHAR), IN param2 INT)
BEGIN
  FOR x AS SELECT Categories.CategoryName, Categories.CategoryId
           FROM /shared/access/Categories Categories
  DO
    IF x.CategoryId = param2 THEN
      INSERT INTO param1 (col1) VALUES (x.categoryName);
    END IF;
  END FOR;
  CLOSE param1;
END