Using unload in a store procedure
Posted in 1997
Topics: Stored Procedures & SPL, Server Administration, Migration, Import/Export & Data Conversion, Platform-Specific Issues
Hi,
I am using INFORMIX-OnLine Version 7.20.UC3 on Sun Ultra running Solaris
2.5.1.
I want to use unload inside a store procedure:
create procedure test()
unload to 'cust.unl' delimiter '|'
select c.customer_id ,
c.prefer_email_id,
c.prefix ,
c.lastname,
c.email
from customer c,
preferemail d
where c.prefer_email_id = d.prefer_email_id and
c.prefer_email_id is not null and
c.email is not null and
c.email like '%@%' and
d.prefer_email_id != '0';
end procedure;
I keep getting a syntax error around the "unload" statement when I try
to create the above store procedure inside dbaccess.
if I commented the create procedure and end procedure line and run the
SQL in dbaccess, it works...
1) My question is, can I use unload inside a store procedure?
2)If not, how can I output my query result to a Unix system file with
a given delimiter?
3) I try "output to" , it still failed inside a store procedure, and
the format is not the way I wanted it.
Your help is greatly appreciated.
Laam Wong
lwong@icon.com