Free PL/SQL Online Formatter
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Free PL/SQL Online Formatter

Hybrid View

  1. #1
    Join Date
    Dec 2004
    Posts
    5

    Free PL/SQL Online Formatter

    Hi, I added PL/SQL formatting rules in version 2 of my free online SQL Formatter on . I appreciate any feedback.

    Regards
    GuidoMarcel
    Last edited by marist89; 09-08-2005 at 01:34 PM.

  2. #2
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587

    Nice

    Just tested some of unformatted code. Seems nice tool. Keep it up.
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  3. #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 11:45 AM.

  4. #4
    Join Date
    Dec 2004
    Posts
    5
    HI tamilselvan,
    thank you for your feedback.
    I played around with your SQL but I could not reproduce the problem.

    I get the formatting like this:

    Code:
    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 ;
    I would really like to eliminate this error. Could you please describe in more details what you did. thanks for your effort in advance

    GuidoMarcel

  5. #5
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    The SQL was captured from query output and was opened in vi editor.
    That may be the reason I am getting the wrong format.

    Tamil

  6. #6
    Join Date
    Dec 2004
    Posts
    5
    Hi Tamil,
    thanks for your feedback

    Regards
    Guido

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