[心得] 舊系統整合 VB+Oracle > VB.net + SQL server

近期接手一個Migration Project, 舊系統由舊的VB6+ Oracle 轉換到VB.net + SQL Server, 過程中有些心得, 故記下來以供大家參考.

通常做Migration 若果要安全至上的話, 都會整合完一個到另一個, 但若果之前的technology 太舊或者時間急切, 不得已下也要這樣做. 在這裡會分開 VB > VB.net 和 Oracle > SQL server 以作區分.

VB > VB.net

  VB VB.net  Remarks
預設值 “” NULL 變數預設值不同, 會容易出現Exception, 而且有時亦需要區分真的是檢查string 是 empty string 還是check null;
Listview Item 起始值 1 0 0 和1 的不同, 若在looping 中VB.net會發生IndexOutOfRangeException.

Oracle > SQL server

  Oracle SQL Server  
substring  SubStr() SubString() 主要是句法不同, 若不是ASCII SQL 的話, 通常都會有出入.
Check null NVL() IsNull()  
叫用Linked Server <<TableName>>@to_link_server to_link_server.dbo.<<TableName>>  
Trimming Trim(<<String>>) LTrim(RTrim(<<String>>))  
取字串長度 Length() Len()  
檢查多條key 於相同table 中
where (key1, key2, key3) in (select key1, key2, key3)

Where Exists (select key1, key 2, key3 from t1 where key1=t.key1 and key2=t.key2 and key3=t.key3
)
 
Join table where t1.key1=t2.key2 (+) t1 left join t2 on t1.key1=t2.key2;  
About C.H. Ling 260 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.