Trying to dump Query Log

Post Reply
hqweb
Posts: 22
Joined: Wed Sep 03, 2003 3:59 am

Trying to dump Query Log

Post by hqweb »

Hello,
We are trying to write the contents of the query log to a text file with the following code inserted in the applysettings part of the dowalk script.

<!-- JFB:2003-12-03 - START of update -->
<!-- This code must be inserted after SETTINGS is called, but -->
<!-- BEFORE the database is deleted and recreated -->
<!-- Dump querylog before next walk -->
<strfmt "E:/Inetpub/ftproot/query_log_live_%at.txt" "%Y%m%d%H%M%S" now>
<$qlfile = $ret>
<$rowcnt = 0>
<db=$dblive><!-- the one that is going to be dropped -->
<write $ret>
GO: dump QUERYLOG in $dblive (live) to $qlfile
ID, Client, Query
<sql row "SELECT CONVERT(id, 'date') id, Client, Query FROM querylog">
$id $Client $Query
<$rowcnt = ($rowcnt + 1)>
</sql>
EOF - $rowcnt rows retrieved
</write>
<!-- JFB:2003-12-03 - END of update -->
We manage to create the file but get the following error message.

002 E:\Inetpub\wwwroot\final\webinator\dowalk(applysettings) 471: can't open E:\Appls\MORPH3\texis\default\db2: No such file or directory in the function ddopen

000 E:\Inetpub\wwwroot\final\webinator\dowalk(applysettings) 471: Could not connect to E:\Appls\MORPH3/texis/default/db2 in the function openntexis
EOF - 0 rows retrieved

Have we got the code in the wrong place? Where exactly in the dowalk script should the code be placed?
thanks.
Niamh
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Trying to dump Query Log

Post by mark »

BTW, you don't have to count rows, vortex does that for you. Just reference $loop instead of $rowcnt after </sql>.
mmcfadden
Posts: 158
Joined: Tue May 20, 2003 2:17 pm

Trying to dump Query Log

Post by mmcfadden »

We are trying to accomplish the same thing. If your were able to successfully modify the dowalk script can we have a copy. This would be a great benefit to us to be able to hold onto our query log beyond the rewalk. Thank you
Post Reply