Jumat, Februari 04, 2011

Firebird & MSSQL

Firebird yang saya gunakan adalah versi 2.5.

Select field into variabel

MSSQL:
select @Shift2StartTime = wts_ShiftStart, @Shift2_8Hr_EndTime = wts_ShiftEnd, @WorkTimeShift2ID = wts_ID
from tbmst_worktimeshift with (nolock)
where wts_HDID = @WorkTimeID and datepart(hh, wts_ShiftCheck)=15

Firebird:
select Shift1StartTime, Shift1_8Hr_EndTime, WorkTimeShift1ID
from tbmst_worktimeshift
where wts_HDID = WorkTimeID and extract(hour from wts_ShiftCheck)=8
into :wts_ShiftStart, :wts_ShiftEnd, :wts_ID;

Pengecekan NULL - ISNULL()
MSSQL:
select isnull(shifta,0), WipeDateTimeIn, WipeDateTimeOut, isnull(hw,0),
isnull(reff,0), isnull(attendtype,0)
from tbta_attendancemtx

Firebird:
select coalesce(shifta,0), WipeDateTimeIn, WipeDateTimeOut, coalesce(hw,0),
coalesce(reff,0), coalesce(attendtype,0)
from tbta_attendancemtx

Mengambil fungsi tanggal dan jam

MSSQL:

Select wtbID,
datepart(hh,wtbBreakStart), datepart(mi,wtbBreakStart),
datepart(hh, wtbBreakEnd), datepart(mi, wtbBreakEnd)
From TBMST_WorkTimeBreak

Firebird:
select extract(hour from wts_ShiftStart), extract(minute from wts_ShiftStart),
extract(hour from wts_ShiftEnd), extract(minute from wts_ShiftEnd),
wts_ID
from tbmst_worktimeshift

Execute procedure returning variables
MSSQL:
exec spatt_getworktime @wipedate, @shift, @starttime output, @endtime output,
@midstart output, @midend output, @lastbreakstart output,
@lastbreakend output

Firebird:
execute procedure spatt_getworktime wipedate, ishift
returning_values starttime, endtime, midstart, midend, lastbreakstart,
lastbreakend;

Penambahan string
MSSQL : select ''GA - ''+ sec_name from table
Firebird : select ''GA - '' || sec_name from table

Perbandingan mode arsitektur Firebird 2.5 antara Classic, SuperClassic, dan SuperServer bisa dilihat disini.

[berlanjut]

Tidak ada komentar: