0
我已经创建了可用于Oracle和Access数据库的查询。 查询是一个简单的select
experssion包含通配符。任何数据库的通用查询
string query = @"SELECT t_package.Package_ID FROM t_package
WHERE t_package.PackageFlags
LIKE '#WC#VCCFG=#WC#CheckedOutTo=#WC#'";
//set the wild card according to the DBMS type that current repository based on.
string wildCardCharacter = "";
wildCardCharacter = RepositoryType().Contains("Access") == true? "*" : "%";
//Replace wild card characters with the appropriate one.
query = query.Replace("#WC#", wildCardCharacter);
我想查询中也适合以下数据库:
• MS SQL服务器
• MySQL的
• 的Oracle9i 和10g的
• PostgreSQL的
• MSDE
• Adaptive Server Anywhere
• Progress OpenEdge
任何想法如何为每个设置适当的通配符?
你忘了提及你的编程语言是什么,但我想这”会有关联数组,字典或类似的数据结构。那是我的选择。 –
@ÁlvaroG.Vicario,谢谢,它是C#。 – user3165438