ON Line SQL Formatter (線上SQL轉換)
Tuesday, July 17, 2007 by Anchi
這個網站提供IT/MIS資訊人員將不同的SQL (Oracle,mysql,MSSql,..) 轉換成更容易閱讀的格式(在修改Trace別人的程式真的超好用),甚至將 SQL/PLSQL Statement 轉換成不同程式語言(用不同程式來組合產生SQL),這個功能我相信對公司中常寫 VB,ASP,C#,perl,PHP等網頁程式的人真是一大福音阿,又快又正確,不會搞半天腦筋都打結,還不一定能夠組合出複雜的SQL (傳到後端的資料庫).
1. 以下為原本完全沒有格式Style的 SQL statement.
select '黨產' from KMT union select '黑金' from KMT union select '貪腐' from KMT union select '反民主' from KMT union select '228屠殺真相' from KMT
2. 透過 Instant SQL Formatter 網站轉換的結果馬上真象大白
SELECT '黨產'
FROM KMT
UNION
SELECT '黑金'
FROM KMT
UNION
SELECT '貪腐'
FROM KMT
UNION
SELECT '反民主'
FROM KMT
UNION
SELECT '228屠殺真相'
FROM KMT
DEMO Part II
CONNECT ass/ass@ADMPROD
CREATE TABLE ASSET_INSTRUMENT (
ASSET_ID NUMBER NOT NULL,
INSTRUMENT_NAME VARCHAR2(255) NOT NULL,
INSTRUMENT_SPEC VARCHAR2(255),
STANDARD_TYPE VARCHAR2(20) NOT NULL,
LAST_TEST_DATE DATE,
STANDARD_ACCEPT VARCHAR2(30),
TEST_TYPE VARCHAR2(4),
TEST_PERIOD NUMBER,
LAST_UPDATE_DATE DATE,
LAST_UPDATED_BY NUMBER,
CREATION_DATE DATE,
CREATED_BY NUMBER,
LAST_UPLDATE_LOGIN NUMBER)
/
CREATE UNIQUE INDEX ASSET_INSTRUMENT_U1 ON ASSET_INSTRUMENT (
ASSET_ID)
/
GRANT all on ASSET_INSTRUMENT to APPS
/
CONNECT scott/tiger@ADMPROD
CREATE SYNONYM ASSET_INSTRUMENT FOR ASS.ASSET_INSTRUMENT
/
CREATE TABLE ASSET_INSTRUMENT (
ASSET_ID NUMBER NOT NULL,
INSTRUMENT_NAME VARCHAR2(255) NOT NULL,
INSTRUMENT_SPEC VARCHAR2(255),
STANDARD_TYPE VARCHAR2(20) NOT NULL,
LAST_TEST_DATE DATE,
STANDARD_ACCEPT VARCHAR2(30),
TEST_TYPE VARCHAR2(4),
TEST_PERIOD NUMBER,
LAST_UPDATE_DATE DATE,
LAST_UPDATED_BY NUMBER,
CREATION_DATE DATE,
CREATED_BY NUMBER,
LAST_UPLDATE_LOGIN NUMBER)
/
CREATE UNIQUE INDEX ASSET_INSTRUMENT_U1 ON ASSET_INSTRUMENT (
ASSET_ID)
/
GRANT all on ASSET_INSTRUMENT to APPS
/
CONNECT scott/tiger@ADMPROD
CREATE SYNONYM ASSET_INSTRUMENT FOR ASS.ASSET_INSTRUMENT
/