-- SelectSessionKanri=
SELECT
  USER_ID,
  LOGON_SESS_PRM,
  SAISHU_SHORI_DTM,
  TICKET_PRM,
  LOGON_DTM,
  LOGOFF_DTM,
  LOGOFF_SBT
FROM
  SESSION_KANRI
WHERE
  USER_ID = /*:UserId*/''
;
-- SelectSessionKanriForUpdate=
SELECT
  USER_ID,
  LOGON_SESS_PRM,
  SAISHU_SHORI_DTM,
  TICKET_PRM,
  LOGON_DTM,
  LOGOFF_DTM,
  LOGOFF_SBT
FROM
  SESSION_KANRI
WHERE
  USER_ID = /*:UserId*/''
FOR UPDATE NOWAIT
;
-- InsertSessionKanri=
INSERT INTO
  SESSION_KANRI
(
  USER_ID,
  LOGON_SESS_PRM,
  TICKET_PRM,
  SAISHU_SHORI_DTM,
  LOGON_DTM,
  LOGOFF_SBT
) VALUES (
  /*:UserId*/'',
  /*:LogonSessionParam*/'',
  '',
  /*:currentDtm*/TO_TIMESAMP('20140101122334', 'YYYYMMDDHH24MISS'),
  /*:currentDtm*/TO_TIMESAMP('20140101122334', 'YYYYMMDDHH24MISS'),
  ''
)
;
-- UpdateSessionKanri=
UPDATE
  SESSION_KANRI
SET
  LOGON_SESS_PRM = /*:LogonSessionParam*/'',
  TICKET_PRM = '',
  SAISHU_SHORI_DTM = /*:ShoriDtm*/TO_TIMESAMP('20140101122334', 'YYYYMMDDHH24MISS'),
  LOGON_DTM = /*:LogonDtm*/TO_TIMESAMP('20140101122334', 'YYYYMMDDHH24MISS'),
  LOGOFF_DTM = /*:LogoffDtm*/TO_TIMESAMP('20140101122334', 'YYYYMMDDHH24MISS'),
  LOGOFF_SBT = /*:LogoffSbt*/''
WHERE
  USER_ID = /*:UserId*/''
;
-- UpdateShoriDtm=
UPDATE
  SESSION_KANRI
SET
  SAISHU_SHORI_DTM = /*:ShoriDtm*/TO_TIMESAMP('20140101122334', 'YYYYMMDDHH24MISS')
WHERE
  USER_ID = /*:UserId*/''
  AND LOGON_SESS_PRM = /*:LogonSessionParam*/''
;
-- UpdateTicket=
UPDATE
  SESSION_KANRI
SET
  TICKET_PRM = /*:Ticket*/''
WHERE
  USER_ID = /*:UserId*/''
;
-- SelectUserInfo=
SELECT
  USER_ID
FROM
  M_USER_INFO
WHERE
  USER_ID = /*:UserId*/''
  AND PASS_WD = /*$PassWd*/''
;
