SELECT
ParticipantNote.participantNoteID,
ParticipantNote.participantID,
ParticipantNote.recordStatus,
ParticipantNote.noteID,
Note.sensitivityCode,
Note.creationDateTime,
Note.priorityCode,
Users.fullName,
Note.notesText,
Note.userName,
Note.subjectText,
ParticipantNote.versionNo
INTO
:participantNoteID,
:participantID,
:recordStatus,
:noteID,
:sensitivityCode,
:creationDateTime,
:priorityCode,
:fullname,
:notesText,
:userName,
:subjectText,
:versionNo
FROM
ParticipantNote,
Note,
Users
WHERE ParticipantNote.participantID = :participantID
AND Note.noteID = ParticipantNote.noteID
AND Note.userName = Users.userName
UNION ALL
SELECT
ParticipantNote.participantNoteID,
ParticipantNote.participantID,
ParticipantNote.recordStatus,
ParticipantNote.noteID,
Note.sensitivityCode,
Note.creationDateTime,
Note.priorityCode,
ExternalUser.fullName,
Note.notesText,
Note.userName,
Note.subjectText,
ParticipantNote.versionNo
FROM
ParticipantNote,
Note,
ExternalUser
WHERE ParticipantNote.participantID = :participantID
AND Note.noteID = ParticipantNote.noteID
AND Note.userName = ExternalUser.userName
|