Search code examples
t-sqlplsqloracle11gsybase

HOW I can Translate from Sybase script To create Views and Indexes Structure


I have the migrate from sybase to Oracle but the code is diferent in lógic and structure, how I Can pass this code to Oracle usung multiple Replace with converts and values after the replace

Here the example in Sybase

Create view dbo.View23 As Select
daftres.jicuenta
,STR_REPLACE (STR_REPLACE(STR_REPLACE(CDATYU.FSFILES,'|','/'),CHAR(10),NULL,CHAR(12),NULL AS CDATTYU_DSNOMICLIENT
,CDATTYU.Duregrimod
CONVERT (CHAR(8),CDATTY.DUYTUH,112)+CONVERT(CHAR(8),CDATTYU.dddultmo,108) As CDATTYU_JDEDFILE
LEFT JOIN CCLARO ON CDATTYU .JKDJDJJUN = SUBSTRING(CDATTYU.KSUHFHF.1.6)
WHERE CONVERT (DATE,CDSTYYU.JDJFJFJFJ 112)<CONVERT (date.'20210311',112)

Thanks


Solution

    • To replace strings in strings Oracle uses replace().
    • To convert strings into dates to_date() can be used and to_char() for the opposite.
    • To get a character by its ordinal chr() can be used.
    • To get a substring of a string Oracle uses substr().