Writing into Files from Stored Procedures
Posted in 2009
Topics: SQL Development & Query Writing, Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
Hello Everybody, I'm trying to write the result set of a sql query into a file, from a stored procedure. My purpose is to make possible this : when an external program access to my database, a trigger is called. This trigger then backups the result set of the query into a file. I have no idea of how to write a file from a trigger or a stored procedure, so any help is welcome ;)
Hi, here you have a way to do it :
create procedure my example
...
...
...
{
Informations pour le log file :
}
let what_action = "qteori - upd :";
let log_str = to_day || ' ' || what_action || ' ' || cdmv || ' ' ||
nomv || ' ' || cdprod || ' ' || " Qte : " || d_qte_save;
{
Ecriture du log file :
}
system 'echo ' || log_str ||
'>> /usr2/expl/stock/log/stk_upd_reserv_rd.log';
end if
end procedure
HIH. Regards,
Olmedo Monteverde
OLF S. A.
1701 Fribourg, Switzerland
-----Message d'origine-----
De : ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] De la part de MARC
AURELE SEVERUS
Envoyé : mardi, 5. mai 2009 12:29
À : ids@iiug.org
Objet : Writing into Files from Stored Procedures [15674]
Hello Everybody,
I'm trying to write the result set of a sql query into a file, from a stored
procedure.
My purpose is to make possible this : when an external program access to my
database, a trigger is called. This trigger then backups the result set of the
query into a file.
I have no idea of how to write a file from a trigger or a stored procedure, so
any help is welcome ;)
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.