혹 인터베이스 사용하시는 분들 중에 이런 방법 아시는 분 있나요?
1. 테이블의 존재 여부 알아 내는 방법
2. 트리거 사용법
2. Date 형을 포맷에 맞게 만들어 주는 함수
3. ISQL/DSQL 에 관한 정보가 잘 나온 책자...
이것은 MS SQL의 트리거 인데요
이걸 Interbase 용으로 바꾸고 싶어서요
USE dkee
GO
IF EXISTS
(
select name
from sysobjects
where name = 'test_put_savetime' and xtype = 'TR'
)
DROP TRIGGER test_put_savetime
GO
CREATE TRIGGER test_put_savetime ON test
FOR INSERT
AS
begin
declare @savetime char(17)
set @savetime = (
select replace(
str(datepart(YY, getdate()), 4) +
str(datepart(MM, getdate()), 2) +
str(datepart(DD, getdate()), 2) +
str(datepart(HH, getdate()), 2) +
str(datepart(MI, getdate()), 2) +
str(datepart(SS, getdate()), 2) +
str(datepart(MS, getdate()), 3),
' ', '0')
)
update test set tg_savetime = @savetime, tg_upload = '0'
where tg_savetime is null and tg_upload is null
end
GO