All Downloads are FREE. Search and download functionalities are using the official Maven repository.

e.ibis-adapterframework-core.7.9.5.source-code.SqlTranslationPatterns.properties Maven / Gradle / Ivy

The newest version!
#
# SqlTranslationPatterns.properties
#
# Specifies sources regexes and replacement targets for SQL translation between SQL dialects
# For each required translation specify:
# .source.=
# .target.=
# Use $0 in a replacement pattern to obtain the full source match
# If no target replacement is found for a source pattern for a given label, or the replacement is equal to $0,
# then the translation is ignored for that label.
#

# Oracle source used a.o. in testscenarios: ApiListener, JdbcQueryListener, BatchFileTransformerPipe, (Big)ClobAndBlob, XmlQuerySender
# 'nextval' as the value to insert in the autoincrement column
nextval.source.Oracle     =(\w+)\.NEXTVAL
nextval.target.H2         =NEXT VALUE FOR $1
nextval.target.MS_SQL     =NEXT VALUE FOR $1
nextval.target.MySQL      =NULL
nextval.target.MariaDB    =NULL
nextval.target.PostgreSQL =nextval('$1')

# Oracle source used a.o. in testscenarios: BatchFileTransformerPipe, (Big)ClobAndBlob
currval.source.Oracle     =(\w+)\.CURRVAL
currval.target.H2         =currval('$1')
currval.target.MS_SQL     =(SELECT current_value FROM sys.sequences WHERE name = '$1')
currval.target.MySQL      =LAST_INSERT_ID()
currval.target.MariaDB    =LAST_INSERT_ID()
currval.target.PostgreSQL =currval('$1')

# Oracle source used a.o. in testscenarios: BatchFileTransformerPipe, (Big)ClobAndBlob, XmlQuerySender
empty_blob.source.Oracle  =EMPTY_BLOB\(\)
empty_blob.target.DB2     =EMPTY_BLOB
empty_blob.target.H2      =''
empty_blob.target.MS_SQL  =0x
empty_blob.target.MySQL   =''
empty_blob.target.MariaDB =''
empty_blob.target.PostgreSQL =''

# Oracle source used a.o. in testscenarios: BatchFileTransformerPipe, (Big)ClobAndBlob, XmlQuerySender
empty_clob.source.Oracle  =EMPTY_CLOB\(\)
empty_clob.target.DB2     =EMPTY_CLOB
empty_clob.target.H2      =''
empty_clob.target.MS_SQL  =0x
empty_clob.target.MySQL   =''
empty_clob.target.MariaDB =''
empty_clob.target.PostgreSQL =''

# Oracle source used a.o. in testscenarios: JdbcQueryListener, ResultSetIteratingPipe, XmlQuerySender
sysdate.source.Oracle     =SYSDATE
sysdate.target.DB2        =CURRENT DATE
sysdate.target.H2         =CURRENT_DATE
sysdate.target.MS_SQL     =GETDATE()
sysdate.target.MySQL      = SYSDATE()
sysdate.target.MariaDB    = SYSDATE()
sysdate.target.PostgreSQL = localtimestamp

# Oracle source used a.o. in testscenarios: ResultSet2FileSender
systimestamp.source.Oracle     =SYSTIMESTAMP
systimestamp.target.DB2        =CURRENT TIMESTAMP
systimestamp.target.H2         =CURRENT_TIMESTAMP
systimestamp.target.MS_SQL     =CURRENT_TIMESTAMP
systimestamp.target.MySQL      =CURRENT_TIMESTAMP()
systimestamp.target.MariaDB    =CURRENT_TIMESTAMP()
systimestamp.target.PostgreSQL =localtimestamp

# Oracle source used a.o. in unitTest for FixedQuerySender
add_months.source.Oracle     =ADD_MONTHS\(([^,]+),([^\(\)]+(\(\w*\))?)\)
add_months.target.H2         =DATEADD(MONTH,$2,$1)
add_months.target.MS_SQL     =DATEADD(MONTH,$2,$1)
add_months.target.MySQL      =DATE_ADD($1, INTERVAL $2 MONTH)
add_months.target.MariaDB    =ADD_MONTHS($1,$2)
add_months.target.PostgreSQL =$1::date + ($2 || ' month')::interval

# Oracle source used a.o. in testscenarios: BatchFileTransformerPipe, (Big)ClobAndBlob
dual.source.Oracle=\s*FROM DUAL
dual.target.Oracle=\ FROM DUAL
dual.target.DB2   =\ FROM SYSIBM.SYSDUMMY1
dual.target.H2    =
dual.target.MS_SQL=
dual.target.PostgreSQL=

# Oracle source used a.o. in testscenarios: BatchFileTransformerPipe, (Big)ClobAndBlob
#FOR UPDATE can only be used on a single table. See the JDBC 2.1 API Specification, section 5.6 for more details
for_update.source.Oracle     =SELECT(\s+\w+)\s+FROM(\s+\w+\s)WHERE(\s\w+)(\s*=.*)FOR\s+UPDATE
for_update.target.H2         =SELECT$1,$3 FROM $2 WHERE $3$4FOR UPDATE
for_update.target.MySQL      =SELECT$1,$3 FROM $2 WHERE $3$4FOR UPDATE
for_update.target.MariaDB    =SELECT$1,$3 FROM $2 WHERE $3$4FOR UPDATE
for_update.target.PostgreSQL =SELECT$1,$3 FROM $2 WHERE $3$4FOR UPDATE

# Oracle source used a.o. in testscenarios: RestListener
length.source.Oracle=LENGTH\((\w+)\)
length.target.MS_SQL=DATALENGTH($1)

# Oracle source in testscenario JdbcListener\JdbcQueryListener
limit.source.Oracle  =SELECT((?:.|\n)+)\s+FETCH\s+FIRST\s+([0-9]+)\s+ROWS\s+ONLY
limit.target.H2      =SELECT$1 LIMIT $2
limit.target.MS_SQL  =SELECT TOP $2 $1
limit.target.MySQL   =SELECT$1 LIMIT $2
limit.target.MariaDB =SELECT$1 LIMIT $2

# Oracle source currently not used in test-iaf
grouping.source.Oracle=LISTAGG\((.*),(.*)\)\s*WITHIN\s+GROUP\s*\(ORDER\s+BY(.*)\)
grouping.target.H2    =group_concat($1 ORDER BY $3 SEPARATOR $2)


# Invoking stored procedure
stored_procedures.source.Oracle =^\s*CALL\s+(\w+)\s*\((.*)\)
stored_procedures.target.MS_SQL =EXEC $1 $2

# DDL statements, not tested in iaf-test
seq_minval.source.Oracle=(CREATE\s+SEQUENCE.*)MINVALUE\s+-\d{18,}(.*)
seq_minval.target.H2    =$1MINVALUE -999999999999999999$2

seq_maxval.source.Oracle=(CREATE\s+SEQUENCE.*)MAXVALUE\s+\d{18,}(.*)
seq_maxval.target.H2    =$1MAXVALUE 999999999999999999$2
seq_maxval.target.MS_SQL=$1MAXVALUE 999999999999999999999999999$2


constraints01.source.Oracle=\s*INITIALLY\s+?(IMMEDIATE|DEFERRED)?
constraints01.target.H2    =

constraints02.source.Oracle=\s*(ENABLE\s+|DISABLE\s+)?VALIDATE
constraints02.target.H2    =

constraints03.source.Oracle=\s*(NOT\s+)?DEFERRABLE
constraints03.target.H2    =

constraints04.source.Oracle=\s*(NO)?MONITORING
constraints04.target.H2    =

constraints05.source.Oracle=\s*(NO)?COMPRESS
constraints05.target.H2    =

constraints06.source.Oracle=\s*(NO)?LOGGING
constraints06.target.H2    =

constraints07.source.Oracle=\s*(UN)?RECOVERABLE

constraints08.source.Oracle=\s*(NO)?PARALLEL
constraints08.target.H2    =

constraints09.source.Oracle=\s*(NO)?CYCLE

constraints10.source.Oracle=\s*NOORDER
constraints10.target.H2    =

constraints11.source.Oracle=\s*NOCACHE
constraints11.target.H2    =

constraints12.source.Oracle=\s*CACHE\s+\d+

number_precision.source.Oracle=NUMBER\(\s*\*\s*,\s*(\d+)\s*\)
number_precision.target.H2    =NUMBER(38, $1)

drop_sequence.source.Oracle=DROP\s+SEQUENCE\s+(\w+)
drop_sequence.target.H2    =DROP SEQUENCE IF EXISTS $1

create_trigger.source.Oracle=CREATE\s+OR\s+REPLACE\s+TRIGGER\s+.*END;
create_trigger.target.H2    =

alter_trigger.source.Oracle=ALTER\s+TRIGGER\s+(\w+)\s+(\w+);
alter_trigger.target.H2    =

exit.source.Oracle=EXIT;?
exit.target.H2    =

set_define_off.source.Oracle=SET\s+DEFINE\s+(\w+);
set_define_off.target.H2    =

create_index.source.Oracle=(CREATE\s+(?:UNIQUE\s+)?INDEX.*)\(LOWER\((\w+)\)
create_index.target.H2    =$1($2




© 2015 - 2024 Weber Informatics LLC | Privacy Policy