How to SYSTEM to a file
Posted in 1999
Topics: Stored Procedures & SPL
Hi, I need to write the values of variables in a stored procedure to a file using the SYSTEM command or by any other means.How can I do this ? TIA Sathish Sadagopan
Try something like:
**********
create procedure fileoutput
(
value varchar(100)
);
SYSTEM 'echo '||value||' >>/tmp/output.txt;
end procedure;
**********
You call the procedure normally ie.
execute procedure fileoutput ('hello world');
And the file /tmp/output.txt will contain 'hell world'.
Regards,
---
Steven Livanes
steven@diggy.com
Diggy Internet Services
On Mon, 18 Jan 1999, Sadagopan, Sathish, CFCTR wrote: > > Hi, > I need to write the values of variables in a stored procedure to a file > using the > SYSTEM command or by any other means.How can I do this ? > TIA > Sathish Sadagopan Haven't got my manual to hand, and I haven't used SPL for a while, but it's something like: SYSTEM "echo " || variable || " > file "; The || concatenates the variable (outside the quotes) with the command run by SYSTEM (inside the quotes). (OK, cdi, feel free to shoot me down in flames if I've got this wrong!!). Richard (formerly richardt@TheMusicStore.co.uk, before that r.thomas@csl.gov.uk)