Showing posts with label Create Log Files in Sybase. Show all posts
Showing posts with label Create Log Files in Sybase. Show all posts
StumbleUpon
Share on Facebook

Monday, May 7, 2007

Write Log Files - Sybase

Writing Logs - Text Files using Sybase

If you want to write to a Log file using Sybase use the following
code. Here the log file is not overwritten - it is appended with the
existing text. As the existing text is stored in a variable and
rewritten to the file there will be a gradual slowdown in performance

BEGIN
Declare sbuffer long varchar;
Declare sText long varchar;
Declare iRet integer;
Set sbuffer = xp_read_file('c:\temp\sample.sql');
Set sText = '\n';
Set sText = sText || 'Writing Text @ ' || Now(*);
Set iRet = xp_write_file('c:\temp\sample.sql', sbuffer || sText);
END;
Related Posts Plugin for WordPress, Blogger...