|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Yesterday @ 1:58 PM
Points: 88,
Visits: 291
|
|
IF OUT_PAT_VISIT_ID_V = 'Collected' and NO_OUT_PAT_VISIT_ID_V = 'Collected' THEN :NEW.PAT_VISIT_ID := 'Collected'; ELSIF OUT_PAT_VISIT_ID_V = 'Collected' THEN :NEW.PAT_VISIT_ID := NO_OUT_PAT_VISIT_ID_V; ELSIF NO_OUT_PAT_VISIT_ID_V = 'Collected' THEN :NEW.PAT_VISIT_ID := OUT_PAT_VISIT_ID_V; ELSE IF OUT_PAT_VISIT_START_DTTM_V > NO_OUT_PAT_VISIT_START_DTTM_V THEN :NEW.PAT_VISIT_ID := OUT_PAT_VISIT_ID_V; ELSE :NEW.PAT_VISIT_ID := NO_OUT_PAT_VISIT_ID_V; END IF; END IF; END IF;
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Yesterday @ 8:01 PM
Points: 408,
Visits: 688
|
|
It's hard to provide a translation without the rest of the code, and I don't believe blindly translating it for you would benefit you at all.
I can give you some clues though. Those :parameters would be defined in the rest of the code you haven't supplied, probably as part of a stored procedure or a function. IF-THEN-ELSE works almost the same in T-SQL. Read up on control-flow in T-SQL.
When you say convert to SQL Server, are you porting your database from Oracle to SQL server? If yes then you will need to define the stored procedure with input and output parameters. I suggest reading an intro to T-SQL stored procedures on MSDN. If you are familiar with PL/SQL then it will be very easy for you. If you're not then I suggest you are way out of your depth and asking for straight transliterations on a forum is a bad idea. Note I didn't say translation, because without context you can't translate any language into another language.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 6:36 AM
Points: 3,
Visits: 28
|
|
| use select case for this issue.
|
|
|
|