Home > database >  About using the same set of PB code compatible with multiple databases (such as ORACLE and used)
About using the same set of PB code compatible with multiple databases (such as ORACLE and used)

Time:09-15

Development under the database has been used to do before, and want to be compatible with ORACLE recently, database, but in the process of transformation of many database name of the function is different, if you want to achieve the same set of PB code compatible with the two databases don't know how you normally do, hope you brainstorm published their own views,

CodePudding user response:

refer to the original poster yoan2014 response:
development under the database has been used to do before, and want to be compatible with ORACLE recently, database, but in the process of transformation of many database name of the function is different, if you want to achieve the same set of PB code compatible with the two databases don't know how you normally do, I hope you brainstorm published their own views,


If to be compatible, recommended a unified SQL statements, if want to use SQL, certainly not a line of

Or you can consider to use is essentially, then migrate to oracle, SQL to carry on the corresponding adjustment

CodePudding user response:

Also can consider to use unified interface Jdbc or Odbc, or write a unified function, according to the characteristics of SQL conversion, converted to SQL that can be recognized

CodePudding user response:

If the common to write like this:
Select
(a.c ol1) as col1,
(a.c ol2) as col2
The from table_name a

Is not general do two dw to _ora, _sql to distinguish
Such as dw_mmkt_ora, syntax
(a.c ol1) as col1,
(a.c ol2) as col2
The from table_name a
Where NVL (a.c ol1, 0) & lt;> 0

Such as dw_mmkt_sql, syntax
(a.c ol1) as col1,
(a.c ol2) as col2
The from table_name a
Where isnull (a.c ol1, 0) & lt;> 0

CodePudding user response:

Without general packaging function processing is trouble

CodePudding user response:

Some require a separate treatment,

CodePudding user response:

Not general, make conditions, connect different database, using a different syntax

CodePudding user response:

1, write standard SQL, don't write with features of SQL, such as oracle's decode function,
2, with an odbc connection, odbc also provides some simple function, such as {fn ifnull ()}, can completely replace the NVL isnull characteristics such as function,
3, the complex business logic don't in the database triggers or storage process is complete, can use the database code as far as possible need not to do,
To achieve the above three points, basic can support the market popular relational database,

CodePudding user response:

A set of code compatible with different databases, the need to write a layer of the operation of the database, and all database operations are encapsulated in this layer, all data window with external data sources, so should be able to meet your requirements, upfront fee something behind shelves are set up, efficiency is also not too slow
  • Related