ODBiC Discussion Board


RE: output file, sam, 05-16-2005

You've got your output statements in the wrong place

by Roger Harris, May 16, 2005 12:26

The output command opens a file and leaves it open for all following output, until another output command is encountered. You could reopen it with APPEND for each row, but that's a LOT of unnecessary overhead. Instead, you can just put the first output statement ahead of the line where you write the column headers, leave the file open for the EACHROW loop, then another output statement after the ENDROW to close the file.

<% SELECT * FROM Inv where silo like '%$silo$%' AND location like '%$location$%' AND owner like '%$owner$%' AND app like '%$app$%'%>
<% OUTPUT c:\inventory\eq_inventory.xls %>
SERVER	LOCATION	RACK NUMBER
<% EACHROW %>
$SERVER$	$LOCATION$	$RACKNUM$
<% ENDROW %>
<% OUTPUT %>


Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.