Hi, I added PL/SQL formatting rules in version 2 of my free online SQL Formatter on . I appreciate any feedback.
Regards
GuidoMarcel
Printable View
Hi, I added PL/SQL formatting rules in version 2 of my free online SQL Formatter on . I appreciate any feedback.
Regards
GuidoMarcel
Just tested some of unformatted code. Seems nice tool. Keep it up.
I think you program needs some correction.
Take care of the --.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
Overall, your progam is good.
Good Luck.
Tamil
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:
I would really like to eliminate this error. Could you please describe in more details what you did. thanks for your effort in advanceCode: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 ;
GuidoMarcel
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
Hi Tamil,
thanks for your feedback
Regards
Guido