※ 引述《petertc (PTC)》之銘言:
: 大家好
: 一個問題請教一下
: 我想把在oracle的資料庫轉移到mysql
: 查了資料,大部分事mysql轉oracle
: 請問在業界大家通常都怎麼處理這樣的case呢?
: 感謝~
後來找到一個工具好像可以辦好這件事:SQLways
http://www.ispirer.com/products
不知道有沒有人用過?
我已經人工搬的差不多了,所以沒試過他的wizard,只有用SQL converter轉我程式的sql
簡單的SQL他應該都可以幫你轉好啦,for example:
SELECT COUNT (NO) FROM BANKINFORM WHERE BANKINFORM.END_TIME >= SYSDATE-7 AND
BANKINFORM.BEGIN_TIME <= SYSDATE
經過轉換就會變成:
SELECT COUNT(`NO`) FROM BANKINFORM WHERE BANKINFORM.END_TIME >=
CURRENT_TIMESTAMP -7 AND BANKINFORM.BEGIN_TIME <= CURRENT_TIMESTAMP;
但是在用的時候也有發現問題,像是這段code:
SELECT to_char(TIME,'MM/DD') AS TIME, (DEPOSIT-WITHDRAWAL) AS TOTAL,MEMO FROM
TRANSACTION_ACCT WHERE TRANSACTION_ACCT.ACCOUNT_NO ='49421045' ORDER BY
TO_NUMBER(TRANSACTION_ACCT.NO) DESC
他轉出來的丟到mysql client commend會錯誤:
SELECT STR(`TIME`,'MM/DD') `TIME`,(DEPOSIT -WITHDRAWAL) TOTAL,MEMO FROM
TRANSACTION_ACCT WHERE TRANSACTION_ACCT.ACCOUNT_NO = '49421045' ORDER BY
CAST(TRANSACTION_ACCT.`NO` AS unsigned) DESC;
正確的SQL:
SELECT DATE_FORMAT(TIME,'%m/%d') AS "TIME", (DEPOSIT-WITHDRAWAL) AS
"TOTAL",MEMO FROM TRANSACTION_ACCT WHERE TRANSACTION_ACCT.ACCOUNT_NO
='49421045' ORDER BY CAST(TRANSACTION_ACCT.NO AS SIGNED) DESC
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.139.111