Thursday, 15 May 2014

Q :) How to create table in firebird database ?
Ans :-  create table teacher(
 uid int not null,
 pid int,
 Fname varchar(50),
 Lname varchar(50),
 Qualification char(10),
 dob date,
 Address varchar(150),
 pincode char(10),
 dist varchar(50),
 state varchar(50),
 officePhNo varchar(50),
 phno varchar(50),
 mobile varchar(50),
 emailID varchar(50),
 lastupdation timestamp,
 modby varchar(50));

 alter table teacher add constraint pk_TeacherUID primary key (uid)

 create generator gn_TeacherUID

 create trigger tggBI_TeacherUID for teacher
 active before insert position 0
 as
 begin
   if (new.UID is null) then
   begin
    new.uid = gen_id(gn_teacheruid,1);
   end
 end;