Re: SET EXPLAIN question
Posted in 1997
}>From ilist@rmy.emory.edu Fri Aug 1 12:47:43 1997
}>Received: from rmy.rmy.emory.edu (rmy.rmy.emory.edu [170.140.97.4])
}> by hobbes.dbintellect.com (8.8.6/8.8.6) with ESMTP id MAA28577
}> for <settler@dbintellect.com>; Fri, 1 Aug 1997 12:47:41 -0600 (MDT)
}>Received: (from ilist@localhost) by rmy.rmy.emory.edu (8.7.1/8.7.1) id LAA25044 for informix-list-out; Fri, 1 Aug 1997 11:30:01 -0400 (EDT)
}>From: Scott Campbell <scott@landmark.com>
}>Message-Id: <33E1EC73.3F48@landmark.com>
}>Subject: SET EXPLAIN question
}>Date: Fri, 01 Aug 1997 10:02:27 -0400
}>Reply-To: Scott Campbell <scott@landmark.com>
}>Organization: Landmark Systems Corporation
}>Sender: informix-list-owner@rmy.emory.edu
}>To: informix-list@rmy.emory.edu
}>X-Informix-List-Id: <news.41106>
}>
}>Is anyone out there aware of a way to override sqexplain.out as the
}>default output file for SET EXPLAIN? I want to send the output to a
}>different file whose name is based on a session ID.
}>
}>Thanks in advance,
}>Scott
}>
}>********************************************************************
}>* Scott C. Campbell | Voice : (703)902-8218 *
}>* Sr. Software Development Specialist | Fax : (703)790-3391 *
}>* Landmark Systems Corporation | E-mail: scott@landmark.com *
}>* 8000 Towers Crescent Drive | *
}>* Vienna, VA 22182 | http://www.landmark.com *
}>********************************************************************
}>
I've never tried it, but if you could figure out the session
identifier for a session you've just entered, you could do
this:
/usr/people/informix> dbaccess stores7 <<EOF
} ! rm sqexplain.out
} ! ln -s sqexplain.out yourfilename.out
} SELECT *
} FROM ORDERS
} ;
} EOF
The ! shells out so you can execute UNIX system commands. The
ln -s command creates a symbolic link named sqexplain.out.
When Informix writes to sqexplain.out, you end up with a real
file named yourfilename.out.
If you figure out how to get the session identifier, or if you
figure out another way to accomplish your goal, please share.
-------------------------------------------------------------------
Jeff Craig | dbINTELLECT Technologies, Inc.
Senior Consultant | Golden, CO
| (303) 275-6954 ext. 8008
| email: settler@dbintellect.com
| fax: (303) 275-2134
-------------------------------------------------------------------