DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Free PL/SQL Online Formatter

Threaded View

  1. #3
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    I think you program needs some correction.

    Code:
    Original SQL Statement:
    SELECT
    --     a.osuser               "OS User",
           c.spid                 "PID",
           a.username             "ORA User",
           to_char(a.sid)||','||to_char(a.serial#)    "ORA Sid",
           a.status               "Status",
    --       substr(a.program,1,25) "Program",
           b.sql_text             "SQL Text"
    FROM v$session a, v$sqltext_with_newlines b, v$process c
     WHERE a.sql_address = b.address
     AND a.sql_hash_value = b.hash_value
     AND a.type != 'BACKGROUND'
     AND a.paddr = c.addr
    ORDER BY a.status, a.osuser, a.username, a.sid, b.piece ;
    
    Formatted SQL from your web site:
    SELECT 
        --     a.osuser               "OS User", 
        c.spid "PID"
        , a.username "ORA User"
        , to_char(a.sid)||','||to_char(a.serial#) "ORA Sid"
        , a.status "Status"
        , 
        --       substr(a.program,1, 
        25)
    *********************************************
    * Last bracket has no matching OPEN bracket *
    ********************************************* "Program"
        , b.sql_text "SQL Text" 
    FROM v$s ession a
        , v$sqltext_with_newlines b
        , v$process c 
    WHERE a.sql_ad dress = b.address 
        AND a.sql_hash_value = b.hash_value 
        AND a.ty pe != 'BACKGROUND' 
        AND a.paddr = c.addr 
    ORDER BY a.status
        , a.os user
        , a.username
        , a.sid
        , b.piece
    Take care of the --.
    Overall, your progam is good.
    Good Luck.

    Tamil
    Last edited by tamilselvan; 09-08-2005 at 10:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width