There are numerous incompatibilities between Access/Jet SQL and Oracle SQL, including the following:
1. The date delimiter is "#" in Access and " ' " (single quote) in Oracle.
2. In CHAR Datatype, Oracle returns trailing spaces. Access does not return trailing spaces in String data type. In Oracle, use VarChar2 Datatype.
3. Jet allows use of the "Join" keyword. Oracle uses "(+)" following the joined field(s). Join is not a recognized word in Oracle.
4. IIF() is allowed in Jet but in Oracle, you must use the DECODE function. See Oracle documentation.
5. The following functions in Jet must be translated in Oracle.
| Mid(fld, 2, 2) - Substr(fld, 2, 2) Left(2) - Substr(fld, 1, 2) Right(n) - Substr( fld, Instr(...),n) Len() - LENGTH() Year(Fld) = 1997 - to_char(Fld, 'yyyy') = '1997' Month(Fld) = 6 - to_char(fld, 'mm') = '06' Trim(Fld) - LTrim() or RTrim() |
| Sql = " ... where fldname = 'abc ' ...." |
| select * from Policy where LastName Like 'smith%' |
| select distinct LONGFLD |
| Length(LONGFLD) |
| select * from table where policy in (select policy2 from table2 where .....) |
| ... Set Lastname = 'O''Toole',... |
| ...SQL = SQL & "set LastName = '" & Replace(lsNameVar, "'", "''") & "', " |
| ...Where RTrim(Fld) <> ''..... |
| ... Where Fld is not null.... |
| ... Where STATE <> 'Z'... |
| ...where (STATE <> 'Z' or STATE is Null)... |
| lsLastName = rs!LastName |
| lsLastName = rs.Fields("lastname").value |