One issue with the sed solutions posted up to now: all output from your sqlplus command will be logged with the same time (the time the command was invoked).
This little function should log the time each line in output, which you may find much more usefull in debugging those slow SQL statements:
Edit - Another thing to be aware of is the return status of your sqlplus command will be lost (replaced with that of sed or logoutput), so ensure you don't rely on $? in the script following the sqlplus call
Last edited by Chubler_XL; 11-23-2010 at 11:31 PM..
Reason: Added warning about return status
Hi,
I am using a query like below in my shell script :
{
{
echo "set echo off"
echo "set head off"
echo "whenever sqlerror exit -1;
select NUMBER ||','||
FNAME ||','||
LOC ||','||
... (2 Replies)
HELLO,
I am using such a command to write oracle sqlplus query result to text file:
sqlplus -S xxx/xxx@xxxxxxx @\tmp\2.sql>\tmp\123.txt
Is it possible to script that:
If command succesfull write in \tmp\log.txt:
timestamp and "succeded"
and create 123.txt with results
else
If error... (2 Replies)
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
UNIX Gods,
I'll be running this script from CRON. I need to log the status of each of the six sqlplus calls into a file when this job is kicked off. Any suggestions?
Thanks in advance.
#!/bin/ksh
export USAGE="USAGE: `basename $0` -e <DBUSER> <DBPASSWD> <TNSNAME>"
if ; then
... (2 Replies)
On psql
select titolo,lingua from titolo where titolo ~* 'brivid';
titolo | lingua
------- + ------
Brivido | 1
On Sqlplus/gqsql
SQL> select titolo,genere,anno,lingua from titolo where titolo like '%rivid%';
TITOLO... (6 Replies)
Hi Guys,
I am using set -x in my script to track the flow of the script.
But if i want to write the output of the set -x into a log file, how do i do it?
Thanks,
Ajay (3 Replies)
Hi,
facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there.
ANy idea why sqlplus writes in /tmp and how to change or stop this ? (2 Replies)
Hi
I am trying to write output to a file in columns
I have file in the follwoing:
# cat file
abc
def
#
I am trying to write next output as like
# cat file
abc 123
def 345
#
:mad: (6 Replies)
HI
I am trying to grep 3 characters from hostname and append a character at the end.
I tried as in the following:
root@abag3:~# hostname | cut -c1-3
hyu
Now I am trying to append "g" at the end of this output as in the following.
root@abag3:~# hostname | cut -c1-3 | sed -s... (4 Replies)
Hello,
I am having problem while redirecting output to a file where as on console output is proper.
for dir in */; do printf "%s, " "$dir"; ls -m "$dir"; echo; done > output.txt
Output of above command is coming in single line but when i am redirecting output to a file, single line i... (10 Replies)
Discussion started by: Manoj Rajput
10 Replies
LEARN ABOUT PHP
xslt_set_log
XSLT_SET_LOG(3) 1 XSLT_SET_LOG(3)xslt_set_log - Set the log file to write log messages toSYNOPSIS
void xslt_set_log (resource $xh, [mixed $log])
DESCRIPTION
This function allows you to set the file in which you want XSLT log messages to, XSLT log messages are different than error messages, in
that log messages are not actually error messages but rather messages related to the state of the XSLT processor. They are useful for
debugging XSLT, when something goes wrong.
By default logging is disabled, in order to enable logging you must first call xslt_set_log(3) with a boolean parameter which enables log-
ging, then if you want to set the log file to debug to, you must then pass it a string containing the filename.
PARAMETERS
o $
xh -The XSLT processor link identifier, created with xslt_create(3).
o $log
- This parameter is either a boolean value which toggles logging on and off, or a string containing the logfile in which log
errors too.
RETURN VALUES
No value is returned.
NOTES
Note
Please note that file:// is needed in front of the path when using Windows.
EXAMPLES
Example #1
Using the XSLT Logging features
<?php
$xh = xslt_create();
xslt_set_log($xh, true);
xslt_set_log($xh, getcwd() . '/myfile.log');
$result = xslt_process($xh, 'dog.xml', 'pets.xsl');
echo $result;
xslt_free($xh);
?>
PHP Documentation Group XSLT_SET_LOG(3)