开发者

Suppress reorg rebuild sysmessages in sybase stored proc

开发者 https://www.devze.com 2023-01-26 16:53 出处:网络
I have a stored procedure in Sybase that uses reorg rebuild statement in a loop for all the tables in my database. What I want to do is to suppress the reorg rebuild sysmessages for tables that succed

I have a stored procedure in Sybase that uses reorg rebuild statement in a loop for all the tables in my database. What I want to do is to suppress the reorg rebuild sysmessages for tables that succedeed the procedure and only to print the tab开发者_开发技巧les that were locked etc...thus the problematic ones....The thing is that I did not succeed to find out anything to use in manual or in any workshops...dow you have any idea?

Thanks in advance !!!!!


If you are running the SQL with isql at a command prompt, you can always capture the output in a text file and filter it out with other tools.

Create a script to run the SQL in isql and then use a script that calls a text processing tool (awk,sed,...) to only find the lines of interest.

Here is an example from a windows batch file with a regex that removes lines that start with a space (i.e. Rows Effected messages)

isql -SDBDEV1 -DMyDbName -U%DBLOG% -P%DBPWD% -iLoadBatchStats.sql -o%TEMP%\LoadBatchStats.log
type %TEMP%\LoadBatchStats.log | gawk "/^[ ]/{print $0}" >>%TEMP%\LoadBatchSummary.log
0

精彩评论

暂无评论...
验证码 换一张
取 消