convert Microsoft SQL Server specific query to ORACLE specific query -
hi have following query written microsoft sql server. need convert query oracle syntax. not have knowledge in oracle syntax. need make query work on oracle database. tried many ways no data returned.
select sisprev_student.stu_id, sisprev_student.cwid, sisprev_student.sex, sisprev_student.nok_name, sisprev_student.nok2_name, sisprev_student.birth_dt, sisprev_student.currently_enrolled, sisprev_student.stu_athlete, sisprev_student.livingoncampus, sisprev_student.immigrationstatus, sisprev_student.scholarstatus, sisprev_student.stu_firstname, sisprev_student.stu_middlename, sisprev_student.stu_lastname, sisprev_student.ethnicity sisprev_address right outer join sisprev_student on sisprev_address.studentid = sisprev_student.stu_id left outer join sisprev_email on sisprev_student.stu_id = sisprev_email.studentid left outer join sisprev_phone on sisprev_student.stu_id = sisprev_phone.studentid ((sisprev_student.stu_id '%' + '@studentid' + '%') or ('@studentid' = '')) , ((upper(sisprev_student.stu_firstname) '%' + upper('@studentfirstname') + '%') or ('@studentfirstname' = '')) , ((upper(sisprev_student.stu_middlename) = upper('@studentmiddlename')) or ('@studentmiddlename' = '')) , ((upper(sisprev_student.stu_lastname) '%' + upper('@studentlastname') + '%') or ('@studentlastname' = '')) , ((upper(sisprev_student.nok_name) '%' + upper('@studentnextofkinname') + '%') or ('@studentnextofkinname' = '')) , ((upper(sisprev_address.street) '%' + upper('@studentstreet') + '%') or ('@studentstreet' = '')) , ((upper(sisprev_address.city) '%' + upper('@studentcity') + '%') or ('@studentcity' = '')) , ((upper(sisprev_address.state) '%' + upper('@studentstate') + '%') or ('@studentstate' = '')) , ((upper(sisprev_address.zipcode) '%' + '@studentzipcode' + '%' ) or ('@studentzipcode' = '')) , ((sisprev_student.birth_dt = convert(smalldatetime,'@studentbirthday')) or ('@studentbirthday' = '')) , ((sisprev_phone.phone = '@studentphonenumber') or ('@studentphonenumber' = '')) , ((upper(sisprev_student.sex) = upper('@studentgender')) or ('@studentgender' = '')) group sisprev_student.stu_id, sisprev_student.cwid, sisprev_student.sex, sisprev_student.nok_name, sisprev_student.nok2_name, sisprev_student.birth_dt, sisprev_student.currently_enrolled, sisprev_student.stu_athlete, sisprev_student.livingoncampus, sisprev_student.immigrationstatus, sisprev_student.scholarstatus, sisprev_student.stu_firstname, sisprev_student.stu_middlename, sisprev_student.stu_lastname, sisprev_student.ethnicity
the following needs change:
((upper(sisprev_address.street) '%' + upper('@studentstreet') + '%')
in oracle || concatenation not +
((upper(sisprev_address.street) '%' || upper('@studentstreet') || '%') or ('@studentstreet' = ''))
if @studentstreet comes user input , can empty can check in oracle as
or ('@studentstreet' null)
date:
convert(smalldatetime, '@studentbirthday')
dependig on way receive date string
to_date('@studentbirthday','some date format')
'some date format' ='dd-mm-yyyy' or whatever format handle. oracle data format strings.
Comments
Post a Comment