Create a separate log file

Hi All,
Can anyone suggest me how to create a separate log file(could be any file) from a script to store some unsuccessful MA's.
I have checked the existing IAPI's but found nothing.
Thanks in advance,
srikanth emani

Hi srikanth,
you have to create new class IAPi and then specify the separate log.
KR,
Anacia

Similar Messages

  • How to create separate log files for each deployed web application in oc4j

    Hi All,
    I am using Windows2000, Oracle9iAS(OC4J). Say I have deployed 3 web applications onto this oc4j server. Then how to create 3 different log files so that I can see the log messages(System.out.println's) of each of these web appliations in a different log file.
    Thanks and Regards,
    Ravi.

    Where do the messages printed via ServletContext.log() go? Is this configurable separately by web application? If so, you could at least replace your System.out.println() with sc.log() statements. For exceptions, you could trap them and log them since the log() method takes a throwable as well as a String.
    John H.

  • In Adobe 8 how do you create a bates log file?

    I love this feature in Adobe 9 where one can select "output options" and change the way the bates stamped PDF is saved, to create a log file of bates numbers per document, etc.  Are these same output options and bates log file options available in Adobe 8?  Basically, how do I create a bates log file in Adobe 8?

    This is a great utility---thanks for sharing it!  The Javascripts folder can be hard to find--here's what worked for me:
    For Macbook Pro users using Acrobat Pro X with OS X version 10 or greater,  you’ll want to copy the unzipped “UVSAR_selectiveFlatten.js”  file into the JavaScripts folder located in this path:
    /Applications/Adobe Acrobat X Pro/Adobe Acrobat Pro.app/Contents/Resources/JavaScripts
    *** IMPORTANT:  To be able to see the Contents folder, you must Right-Click (Ctrl-Click if you don't have a right button) on the filename "Adobe Acrobat Pro.app", then select Show Package Contents from the pop-down menu.  The Contents folder will appear in a new window and you can navigate to  Contents/Resources/JavaScripts, and put the “UVSAR_selectiveFlatten.js” into the JavaScripts folder.
    Once you've done that, restart Acrobat Pro and you'll find the "Flatten" option in your Edit menu.  VERY handy!  Tip:  might want to save your original PDF file as a different version just to be safe---once you flatten the PDF, it can't be undone, so either just print and don't save, or save as different version if need be.

  • Is it possible to create materialized view log file for force refresh

    Is it possible to create materialized view log file for force refresh with join condition.
    Say for example:
    CREATE MATERIALIZED VIEW VU1
    REFRESH FORCE
    ON DEMAND
    AS
    SELECT e.employee_id, d.department_id from emp e and departments d
    where e.department_id = d.department_id;
    how can we create log file using 2 tables?
    Also am copying M.View result to new table. Is it possible to have the same values into the new table once the m.view get refreshed?

    You cannot create a record as a materialized view within the Application Designer.
    But there is workaround.
    Create the record as a table within the Application Designer. Don't build it.
    Inside your database, create the materialized with same name and columns as the record created previously.
    After that, you'll be able to work on that record as for all other within the Peoplesoft tools.
    But keep in mind do never build that object, that'll drop your materialized view and create a table instead.
    Same problem exists for partitioned tables, for function based-indexes and some other objects database vendor dependant. Same workaround is used.
    Nicolas.

  • Collect Thread Dump using Script and direct to separate log file

    Dear Legends,
    I request you to provide me some useful guide lines to collect Thread Dump using script in linux and redirect the output to a separate log file, not the STDOUT file. If it is redirecting to STDOUT then how to extract only the thread stack to a separate log file.
    i used
    ps -ef | grep java
    kill -3 <pid> >> ss1_td.log
    but it is not providing the thread stack to the log file.
    Anykind of help would be appreciated much.
    Regards,
    Karthik

    Hi Ram,
    Really a great and useful script for me at the right time. It solved my requirement and i made some changes to my requirement and the script it working fine to collect the thread dump and even i have checked the thread dump with SAMURAI works fine.
    Helpful site also refer sites like these which contains more valuable things for weblogic. We will meet in the forums again.
    Note: also please update several links available in the site like UNIX scripts, WLST, Python etc.
    Regards,
    Karthik

  • Create rman back log file issue in linux

    Hi Experts,
    I run 10.2.04 database in redhat 5.1
    i create a testing shell script for cron job. but I could not create rman backup log file with blank email.
    my code as
    #!/bin/bash
    EXPORT DTE='date +%m%d%C5y%H%M'
    export $ORACLE_HOME/bin
    export $ORACLE_SID=sale
    rman target='backuptest/backuptest@sale4' nocatalog log /urs/tmp/orarman/jimout.log << EOF
    RUN {
    show all;
    EXIT;
    EOF
    mail -s " backup"${DTE} [email protected] < urs/tmp/orarman/jimout.log
    Please advice me for dubug.
    Thanks for your help!
    JIm

    Thanks very much!
    I make changes as below
    #!/bin/bash
    EXPORT DTE='date +%m%d%C5y%H%M'
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
    export ORACLE_SID=sale
    export PATH=$ORACLE_HOME/bin:$PATH
    rman target='backuptest/[email protected]' nocatalog log='/urs/tmp/orarman/log/jimout.log' << EOF
    RUN {
    show all;
    EXIT;
    EOF
    mail -s " backup"${DTE} [email protected] < urs/tmp/orarman/log/jimout.log
    I am still not able see file under log='/urs/tmp/orarman/log/ directory.
    the rman option does not works for log='/urs/tmp/orarman/log/jimout.log'
    What is wrong in my code?
    I am looking for your help!
    JIm
    Edited by: user589812 on Jul 23, 2010 8:36 AM
    Edited by: user589812 on Jul 23, 2010 8:38 AM

  • Legato - creating two separate logs

    Hi,
    We are using Legato Networker with Oracle (running on Solaris). I need to find a way to generate TWO separate reports. One for archive logs backups and the other for the actual database backups.
    I am using the NSR_RMAN_ARGUMENTS within /usr/sbin/nsrnmo_<ORACLE_SID> file which refers to a file that will store the rman report. However, when archivelogs backup occurs it will overwrite the last database backup. What I need is two report files - one for database and the other for archivelogs.
    Is there a way to create two separate reports?
    Many thanks

    Hi,
    It might be that you have to run two jobs, one to back the database and the other to backup the archives.
    rgds
    alan

  • Help with Script created to check log files.

    Hi,
    I have a program we use in our organization on multiple workstations that connect to a MS SQL 2005 database on a Virtual Microsoft 2008 r2 Server. The program is quite old and programmed around the days when serial connections were the most efficient means
    of connection to a device. If for any reason the network, virtual server or the SAN which the virtual server runs off have roughly 25% utilization or higher on its resources the program on the workstations timeout from the SQL database and drop the program
    from the database completely rendering it useless. The program does not have the smarts to resync itself to the SQL database and it just sits there with "connection failed" until human interaction. A simple restart of the program reconnects itself
    to the SQL database without any issues. This is fine when staff are onsite but the program runs on systems out of hours when the site is unmanned.
    The utilization of the server environment is more than sufficient if not it has double the recommended resources needed for the program. I am in regular contact with the support for the program and it is a known issue for them which i believe they do not
    have any desire to fix in the near future. 
    I wish to create a simple script that checks the log files on each workstation or server the program runs on and emails me if a specific word comes up in that log file. The word will only show when a connection failure has occurred.
    After the email is sent i wish for the script to close the program and reopen it to resync the connection.
    I will schedule the script to run ever 15 minutes.
    I have posted this up in a previous post about a month ago but i went on holidays over xmas and the post died from my lack or response.
    Below is what i have so far as my script. I have only completed the monitoring of the log file and the email portion of it. I had some help from a guy on this forum to get the script to where it is now. I know basic to intermediate scripting so sorry for my
    crudity if any.
    The program is called "wasteman2G" and the log file is located in \\servername\WasteMan2G\Config\DCS\DCS_IN\alert.txt
    I would like to get the email side of this script working first and then move on to getting the restart of the program running after.
    At the moment i am not receiving an error from the script. It runs and doesn't complete what it should.
    Could someone please help?
    Const strMailto = "[email protected]"
    Const strMailFrom = "[email protected]"
    Const strSMTPServer = "mrc1tpv002.XXXX.local"
    Const FileToRead = "\\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\alert.txt"
    arrTextToScanFor = Array("SVR2006","SVR2008")
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
    Set oFile = objFSO.GetFile(FileToRead)
    dLastCreateDate = CDate(WshShell.RegRead("HKLM\Software\RDScripts\CheckTXTFile\CreateDate"))
    If oFile.DateCreated = dLastCreateDate Then
    intStartAtLine = CInt(WshShell.RegRead("HKLM\Software\RDScripts\CheckTXTFile\LastLineChecked"))
    Else
    intStartAtLine = 0
    End If
    i = 0
    Set objTextFile = oFile.OpenAsTextStream()
    Do While Not objTextFile.AtEndOfStream
    If i < intStartAtLine Then
    objTextFile.SkipLine
    Else
    strNextLine = objTextFile.Readline()
    For each strItem in arrTextToScanFor
    If InStr(LCase(strNextLine),LCase(strItem)) Then
    strResults = strNextLine & vbcrlf & strResults
    End If
    Next
    End If
    i = i + 1
    Loop
    objTextFile.close
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\FileChecked", FileToRead, "REG_SZ"
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\CreateDate", oFile.DateCreated, "REG_SZ"
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\LastLineChecked", i, "REG_DWORD"
    WshShell.RegWrite "HKLM\Software\RDScripts\CheckTXTFile\LastScanned", Now, "REG_SZ"
    If strResults <> "" Then
    SendCDOMail strMailFrom,strMailto,"VPN Logfile scan alert",strResults,"","",strSMTPServer
    End If
    Function SendCDOMail( strFrom, strSendTo, strSubject, strMessage , strUser, strPassword, strSMTP )
    With CreateObject("CDO.Message")
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTP
    .Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic
    .Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strUser
    .Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strPassword
    .Configuration.Fields.Update
    .From = strFrom
    .To = strSendTo
    .Subject = strSubject
    .TextBody = strMessage
    On Error Resume Next
    .Send
    If Err.Number <> 0 Then
    WScript.Echo "SendMail Failed:" & Err.Description
    End If
    End With
    End Function

    Thankyou for that link, it did help quite a bit. What i wanted was to move it to csript so i could run the wscript.echo in commandline. It all took to long and found a way to complete it via Batch. I do have a problem with my script though and you might
    be able to help.
    What i am doing is searching the log file. Finding the specific words then outputting them to an email. I havent used bmail before so thats probably my problem but then im using bmail to send me the results.
    Then im clearing the log file so the next day it is empty so that when i search it every 15 minutes its clean and only when an error occurs it will email me.
    Could you help me send the output via email using bmail or blat?
    @echo off
    echo Wasteman Logfile checker
    echo Created by: Reece Vellios
    echo Date: 08/01/2014
    findstr "SRV2006 & SRV2008" \\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt > c:\log4mail.txt
    if %errorlevel%==0 C:\Documents and Settings\rvellios\Desktop\DCS Checker\bmail.exe -s mrc1tpv002.xxx.local -t [email protected] -f [email protected] -h -a "Process Dump" -m c:\log4mail.txt -c
    for %%G in (\\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt) do (copy /Y nul "%%G")
    This the working script without bmail
    @echo off
    echo Wasteman Logfile checker
    echo Created by: Reece Vellios
    echo Date: 08/01/2014
    findstr "SRV2006 & SRV2008" \\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt > C:\log4mail.txt
    if %errorlevel%==0 (echo Connection error)
    for %%G in (\\Mrctpv005\WasteMan2G\Config\DCS\DCS_IN\Alert.Txt) do (copy /Y nul "%%G")
    I need to make this happen:
    If error occurs at "%errorlevel%=0" then it will output the c:\log4mail.txt via smtp email using bmail.

  • Create CSV from Log File

    I have a set of logs that that I need to run some analysis on. I'm trying to convert them to a CSV format so I can analyze them with Excel or LogParser.
    The basic process I'm trying to implement is:
    1. Search entries for ERROR in log file
    2. Split components of the error line
    3. Create output CSV.
    I was able to address item 1 with this this statement:
    Select-string -path C:\my\logfile\file.log -Pattern "\W\sERROR:\s" -CaseSensitive -AllMatches | select -expand line
    This is a sample of the output lines I'm getting
    01/31/2014 14:07:00 USERC <25000> ERROR: 1222 - SQLSTATE: HYT00 - Execute failed:  Lock request time out period exceeded. on line 9461 in Quote Entry - Payable, Accounts
    01/31/2014 14:07:11 USERD <25000> ERROR: 1222 - SQLSTATE: HYT00 - Execute failed:  Lock request time out period exceeded. on line 324491 in &Orders on object SELECT_ORD_BTN.
    01/31/2014 15:49:34 USERG <25000> ERROR: 50000 - SQLSTATE: 42000 - Execute failed:  \n\nNo Lines entered. Must finish entering lines. on line 281522 in Quote Entry - Payable, Accounts
    01/31/2014 15:51:01 USERH <25000> ERROR: 50000 - SQLSTATE: 42000 - Execute failed:  \n\nNo Lines entered. Must finish entering lines. on line 281522 in Quote Entry - Payable, Accounts
    I'm having issues breaking these lines into its components. Ideally, I'd like to create an output CSV file that breaks the components of these lines thus:
    DATE, TIME, USER, ERROR, ERRORID, MESSAGE
    Following on the method I mentioned above, I was planning to pipe the output into a foreach and perhaps use regex to extract the parts of the line, but I'm having difficulties. I have the regex figured out, and I have tried combining them with the -split
    operator and the select-string, but I'm not having much luck.
    What is the best method to process these lines so I can split them at specific locations in the string?
    Using one of the example outputs above, I need to split the line in the following spots (note the commas)
    01/31/2014, 15:51:01, USERH, <25000> ERROR:, 50000 - SQLSTATE:, 42000 - Execute failed:  \n\nNo Lines entered. Must finish entering lines. on line 281522 in Quote Entry - Payable, Accounts

    Well, I ended up using
    $mydate=$line.split(" ")[0]
    $myTime=$line.split(" ")[1]
    ... etc
    to extract the first 6 fields in the line as they're all (more or less consistently) separated by spaces. For the final (message) field, I used your recommendation above.
    I redistributed the fields so they'd split at the spaces and I concatenated 
    01/31/2014 | 15:51:01 | USERH | <25000> | ERROR: 50000 - | SQLSTATE: 42000 - | Execute failed:  \n\nNo Lines entered. Must finish entering lines. on line 281522 in Quote Entry - Payable, Accounts.
    Thanks for pointing me in the right direction.

  • Mailaccess.log file - How do I control size/create new mailaccess.log file

    I am running an IMAP/SMTP server on a G5 Xserve. My mailaccess.log file is getting rather large. When I mv then touch to create a new mailaccess.log file the old file that was mv'd continues to get updated while the new mailaccess.log file remaile at 0 with not entries.
    How to refresh my log file?
    thanks
    Jeff

    Hi,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/ee4f58ff1bce41b4dc6d2612fae211/frameset.htm
    and More here..
    Problem with system.log
    Regards,
    N.

  • Create a new log file every hour

    I have a program which receives measurement data and writes this data to TDMS file. However, I want to create a new TDMS file every hour. When I put a while loop in mu sub vi which creates the new file the program doesn't run. I have attached the sub vi. Can anyone help me out here?
    Cheers
    Attachments:
    ConfigTDMS (SubVI)_loopTDMS.vi ‏16 KB

    One trick for doing this is to prepend the file name with YYJJJHH See example
    Then just check if file exists (if not create and add headder) when you write to file.
    This also generates the reports in "alphabetical" order so windows explorer presents them chronologically.
    Jeff

  • To create a custom log files in OSB to a specified location

    Can we get the summary of the total flow process in OSB after execution similar to that of flow trace in BPEL? Ex:-Any invocation failure,no.of retries and time interval to invoke a web service,error details.

    Yes, you may enable tracing and get information in the log. Please refer -
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15867/tracing.htm#BABGACEC
    Regards,
    Anuj

  • Node.js loss of permission to write/create log files

    We have been operating Node.js as a worker role cloud service. To track server activity, we write log files (via log4js) to C:\logs
    Originally the logging was configured with size-based roll-over. e.g. new file every 20MB. I noticed on some servers the sequencing was uneven
    socket.log <-- current active file
    socket.log.1
    socket.log.3
    socket.log.5
    socket.log.7
    it should be
    socket.log.1
    socket.log.2
    socket.log.3
    socket.log.4
    Whenever there is uneven sequence, i realise the beginning of each file revealed the Node process was restarted. From Windows Azure event log, it further indicated worker role hosting mechanism found node.exe to have terminated abruptly.
    With no other information to clue what is exactly happening, I thought there was some fault with log4js roll over implementation (updating to latest versions did not help). Subsequently switched to date-based roll-over mode; saw that roll-over happened every
    midnight and was happy with it.
    However some weeks later I realise the roll-over was (not always, but pretty predictably) only happening every alternate midnight.
    socket.log-2014-06-05
    socket.log-2014-06-07
    socket.log-2014-06-09
    And each file again revealed that midnight the roll-over did not happen, node.exe was crashing again. Additional logging on uncaughtException and exit happens showed nothing; which seems to suggest node.exe was killed by external influence (e.g. process
    kill) but it was unfathomable anything in the OS would want to kill node.exe.
    Additionally, having two instances in the cloud service, we observe the crashing of both node.exe within minutes of each other. Always. However if we had two server instances brought up on different days, then the "schedule" for crashing would
    be offset by the difference of the instance launch dates.
    Unable to trap more details what's going on, we tried a different logging library - winston. winston has the additional feature of logging uncaughtExceptions so it was not necessary to manually log that. Since winston does not have date-based roll-over it
    went back to size-based roll-over; which obviously meant no more midnight crash. 
    Eventually, I spotted some random midday crash today. It did not coincide with size-based rollover event, but winston was able to log an interesting uncaughtException.
    "date": "Wed Jun 18 2014 06:26:12 GMT+0000 (Coordinated Universal Time)",
    "process": {
    "pid": 476,
    "uid": null,
    "gid": null,
    "cwd": "E:
    approot",
    "execPath": "E:\\approot
    node.exe",
    "version": "v0.8.26",
    "argv": ["E:\\approot\\node.exe", "E:\\approot\\server.js"],
    "memoryUsage":
    { "rss": 80433152, "heapTotal": 37682920, "heapUsed": 31468888 }
    "os":
    { "loadavg": [0, 0, 0], "uptime": 163780.9854492 }
    "trace": [],
    "stack": ["Error: EPERM, open 'c:\\logs\\socket1.log'"],
    "level": "error",
    "message": "uncaughtException: EPERM, open 'c:\\logs\\socket1.log'",
    "timestamp": "2014-06-18T06:26:12.572Z"
    Interesting question: the Node process _was_ writing to socket1.log all along; why would there be a sudden EPERM error?
    On restart it could resume writing to the same log file. Or in previous cases it would seem like the lack of permission to create a new log file. 
    Any clues on what could possibly cause this? On a "scheduled" basis per server? Given that it happens so frequently and in sync with sister instances in the cloud service, something is happening in the back scenes which I cannot put a finger to.
    thanks
    The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

    Hi,
    It is  strange. From your description, how many instances of your worker role? Do you store the log file on your VM local disk? To avoid this question, the best choice is you could store your log file into azure storage blob . If you do this, all log
    file will be stored on blob storage. About how to use azure blob storage, please see this docs:
    http://azure.microsoft.com/en-us/documentation/articles/storage-introduction/
    Please try it.
    If I misunderstood, please let me know.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can't create log file with java.util.logging

    Hi,
    I have created a class to create a log file with java.util.logging
    This class works correctly as standalone (without jdev/weblogic)
    import java.io.IOException;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.logging.*;
    public class LogDemo
         private static final Logger logger = Logger.getLogger( "Logging" );
         public static void main( String[] args ) throws IOException
             Date date = new Date();
             DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
             String dateStr = dateFormat.format(date);
             String logFileName = dateStr + "SEC" + ".log";
             Handler fh;          
             try
               fh = new FileHandler(logFileName);
               //fh.setFormatter(new XMLFormatter());
               fh.setFormatter(new SimpleFormatter());
               logger.addHandler(fh);
               logger.setLevel(Level.ALL);
               logger.log(Level.INFO, "Initialization log");
               // force a bug
               ((Object)null).toString();
             catch (IOException e)
                  logger.log( Level.WARNING, e.getMessage(), e );
             catch (Exception e)
                  logger.log( Level.WARNING, "Exception", e);
    }But when I use this class...
    import java.io.File;
    import java.io.IOException;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.logging.FileHandler;
    import java.util.logging.Handler;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import java.util.logging.XMLFormatter;
    public class TraceUtils
      public static Logger logger = Logger.getLogger("log");
      public static void initLogger(String ApplicationName) {
        Date date = new Date();
        DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
        String dateStr = dateFormat.format(date);
        String logFileName = dateStr + ApplicationName + ".log";
        Handler fh;
        try
          fh = new FileHandler(logFileName);
          fh.setFormatter(new XMLFormatter());
          logger.addHandler(fh);
          logger.setLevel(Level.ALL);
          logger.log(Level.INFO, "Initialization log");
        catch (IOException e)
          System.out.println(e.getMessage());
    }and I call it in a backingBean, I have the message in console but the log file is not created.
    TraceUtils.initLogger("SEC");why?
    Thanks for your help.

    I have uncommented this line in logging.properties and it works.
    # To also add the FileHandler, use the following line instead.
    handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandlerBut I have another problem:
    jdev ignore the parameters of the FileHandler method .
    And it creates a general log file with anothers log files created each time I call the method logp.
    So I play with these parameters
    fh = new FileHandler(logFileName,true);
    fh = new FileHandler(logFileName,0,1,true);
    fh = new FileHandler(logFileName,10000000,1,true);without succes.
    I want only one log file, how to do that?

  • Create different log file with different schema by spool

    Hello,
    I want to know a way to create a different log file depend on different schema
    I have two schema on same db server
    1) schema kennam/*****/kennam
    2) schema koonhey/*****/koonhey
    by a way, I want to create a different log file name e.g. kennam.log / koonhey.log on such two schema...
    I always run @showbalance; to run showbalance.sql to create that report..
    I hope you understand what I talking about (english is not my native language........), anyone could help?
    showbalancelog.sql
    spool c:\log.log+
    spool c:\log.log
    select to_char(sysdate,'dd-mm-yyyy hh:mi:ss') from dual;
    column com_name format a20;
    select cus.tid, cus.com_name com_name, cus.com_balance,
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice,
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income,
    cus.com_balance -
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) +
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance
    from customers cus
    order by cus.tid;
    spool off

    okey I solved on this way, is anyone know another simpler way?
    be simpler part
    variable vspoolfile varchar2(20)
    declare
    username varchar2(20);
    spoolfile varchar2(50);
    begin
    select 'c:\' || user || '.log' into spoolfile from dual;
    -- spoolfile := 'c:\' || username || '.log';
    :vspoolfile := spoolfile;
    -- dbms_output.PUT_LINE(spoolfile);
    end;
    -- print :vspoolfile;
    column spoolfilecol new_value definespoolfile noprint
    select :vspoolfile spoolfilecol from dual;full content of my showbalancelog.sql file
    variable vspoolfile varchar2(20)
    declare
    username varchar2(20);
    spoolfile varchar2(50);
    begin
    select 'c:\' || user || '.log' into spoolfile from dual;
    -- spoolfile := 'c:\' || username || '.log';
    :vspoolfile := spoolfile;
    -- dbms_output.PUT_LINE(spoolfile);
    end;
    -- print :vspoolfile;
    column spoolfilecol new_value definespoolfile noprint
    select :vspoolfile spoolfilecol from dual;
    spool &definespoolfile;
    column com_name format a20;
    select cus.tid, cus.com_name com_name, cus.com_balance,
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice,
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income,
    cus.com_balance -
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) +
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance
    from customers cus
    order by cus.tid;
    spool off;

Maybe you are looking for

  • How can I see all the recipients of an email when I reply?

    When I reply to an email that was sent to multiple people, I want to be able to see the original email header that shows the date, time, everyone who received it, etc. In other words, I'd like to see the original header that way it shows when I forwa

  • Panic report, need help diagnosing

    Hello all,  I have a mid 2007 iMac that is randomly crashing. Started locking up about a week ago and now I am getting the following kernel panic report. Need some help troubleshooting if possible: Anonymous UUID:       2FE323A8-17EC-CDE3-8419-BE69D9

  • EHP5 - when will it be available on general release, anyone installed it?

    Hi SDNers, Does anyone know when EHP5 will be released? I see that Note 1171344 SEM-BCS in the context of SAP ERP 6.0 EHP was updated in June with more information on EHP5 features. Does anyone know when it will be on general release? If anyone is cu

  • Download to excel between two given dates

    Hi All, I already implemented Export to Excel funtionality in webdynpro java. Now i have a requirement to download the data to Excel only between two given dates. I am taking two dates from the user and based on that it should download data into exce

  • InDesign CS5 panels and toolbars not working

    Was curious if anyone else has had this problem. I can't seem to get my tools to show up on the left side when I open InDesign and try to get them to pop up. Also, when I try to set up panels such as Swatches, Character, etc. on my screen... I go to