If the output.txt has the value "select * from users", then spooling seems to be not having any issues.
I beleive there are no rows in the table 'users'.
For pipe delimition, use the below, suppose users table has 3 columns,
select field1 || '|' || field2 || '|' || field2 from users;
will give you the delimited values.