Home > Software engineering >  migrate querie update in sybase to oracle
migrate querie update in sybase to oracle

Time:11-19

hi guys i need migrate this querie to oracle

UPDATE t_tel
   SET fec_hora = convert(datetime,substring(date_call,1,8)   " "   hour_init)

I know very little about the database, pls help.

CodePudding user response:

Here's what I think (I don't know Sybase so I looked at documentation; it would be simpler if you explained what you want to get as a result based on input (i.e. DATE_CALL and HOUR_INIT values).

Therefore, a presumption:

  • date_call looks like a date, where first 8 characters represent day, month and year - but I don't know in which format so I presumed it is ddmmyyyy. If it is not, you'll have to use correct format
  • hour_init contains time - again, format is unknown, so I presumed it is hh24mi

If that's so, you'd

update t_tel set
  fec_hora = to_date(substr(date_call, 1, 8) || ' ' || hour_init,
                     'ddmmyyyy hh24mi'
                     );

Format mask ddmmyyyy hh24mi might need to be changed if source data looks differently.

  • Related