DtSQL - FireBird Features

 

 
 

 

 
 

Table

Create Table

FireBird allows to create a new table. After entering the table name and column information, DtSQL can generate and execute the SQL to create the table.

  • Column Name
  • Column Type
  • Length/Precesion
  • Scale (decimal)
  • Default Value
  • Nullable
  • Primary Key
  • Unique

Sample :
CREATE TABLE "TEST_TABLE" (
a bigint DEFAULT 1 NOT NULL,
b char ( 12 ) DEFAULT 'abc' NOT NULL,
c decimal ( 12, 2 ) ,

PRIMARY KEY ( a, b ),
UNIQUE ( b,c )
)

Rename Table

FireBird allows to rename an existing table. After entering the table name, DtSQL can generate and execute the SQL to rename the table.

Sample : ALTER TABLE "TEST_TABLE" RENAME TO TESTTABLE

Truncate Table

FireBird does not allows to truncate an table and deleting table is used instead. After entering the table name, DtSQL can delete all data in the table.

Sample : DELETE FROM "TEST_TABLE"

Drop Table

FireBird allows to drop an existing table. After entering the table name, DtSQL can generate and execute the SQL to drop the table.

Sample : DROP TABLE "TEST_TABLE"

TOP
 

Column

Add Column

FireBird allows to add a new column to an existing table. After selecting the table and entering column information, DtSQL can generate and execute the SQL to add the new column to the table.

  • Column Name
  • Column Type
  • Length/Precesion
  • Scale (decimal)
  • Default Value
  • Nullable

Sample :
ALTER TABLE
"TEST_TABLE"
ADD
d varchar(20) DEFAULT 'def' NOT NULL

Change Data Type

FireBird allows to change the column data. After selecting the new data type, DtSQL can generate and execute the SQL to change the column data type.

Sample :
ALTER TABLE "TEST_TABLE"
ALTER COLUMN F TYPE BIGINT

Rename Column

FireBird allows to rename the column name. After selecting the new column name, DtSQL can generate and execute the SQL to rename the column name.

Sample :
ALTER TABLE "TEST_TABLE"
ALTER COLUMN F TO FF

Drop Column

FireBird allows to delete an existing column. After selecting the column, DtSQL can generate and execute the SQL to delete the column.

Sample :
ALTER TABLE "TEST_TABLE"
DROP F

TOP
 

View

Create View

FireBird allows to create a new view. After entering the view name and select SQL, DtSQL can generate and execute the SQL to create the view.

Sample :
CREATE VIEW "TEST_VIEW"
AS
SELECT * FROM "TEST_TABLE"

Drop View

FireBird allows to drop an existing view. After selecting the view name, DtSQL can generate and execute the SQL to delete the view.

Sample : DROP VIEW "TEST_VIEW"

TOP
 

Index

Create Index

FireBird allows to create a new index. After selecting the table columns and entering the view name, DtSQL can generate and execute the SQL to create the index.

Sample :
CREATE UNIQUE INDEX "TEST_INDEX"
ON TEST_TABLE ( A, B, C )

Drop Index

FireBird allows to drop an existing index. After selecting the index name, DtSQL can generate and execute the SQL to delete the index.

Sample : DROP INDEX "TEST_INDEX"

TOP
 

Trigger

Create Trigger

FireBird allows to create a new trigger. After entering the trigger name and trigger actions, DtSQL can generate and execute the SQL to create the trigger.

Sample :
CREATE TRIGGER "TEST_TRIGGER" FOR "TEST_TABLE"
AFTER INSERT
AS
BEGIN
UPDATE "TEST_TB" SET COL1 = COL1 + 1;
END

Drop Trigger

FireBird allows to drop an existing trigger. After selecting the trigger name, DtSQL can generate and execute the SQL to delete the trigger.

Sample : DROP TRIGGER "TEST_TRIGGER"

TOP
 

Constraint

Create Primary Key

FireBird allows to create a primary key for a table. After selecting the table columns, DtSQL can generate and execute the SQL to create the primary key.

Sample :
ALTER TABLE
"TEST_TABLE"
ADD
PRIMARY KEY ( B, C )

Create Foreign Key

FireBird allows to create a foreign key for a table to reference to another table. After selecting the table columns and referenced table columns, DtSQL can generate and execute the SQL to create the foreign key.

Sample :
ALTER TABLE
"TEST_TABLE"
ADD
FOREIGN KEY ( A, C )
REFERENCES "TEST_TB" (B, A )

Create Check Constraint

FireBird allows to create a check constraint for a table column. After entering the check constraint name and check action, DtSQL can generate and execute the SQL to create the check constraint.

Sample :
ALTER TABLE
"TEST_TABLE"
ADD CONSTRAINT "TEST_CK"
CHECK ( C > 10 )

Create Unique Constraint

FireBird allows to create an unique constraint for a table columns. After entering the unique constraint name and selecting table columns, DtSQL can generate and execute the SQL to create the unique constraint.

Sample :
ALTER TABLE
"TEST_TABLE"
ADD CONSTRAINT "TEST_UQ"
UNIQUE ( B, C )

Drop Primary Key

FireBird allows to drop an existing primary key. After selecting the primary key, DtSQL can generate and execute the SQL to delete the primary key.

Sample : ALTER TABLE "TEST_TABLE" DROP CONSTRAINT "INTEG_128"

Drop Foreign Key

FireBird allows to drop an existing foreign key. After selecting the foreign key, DtSQL can generate and execute the SQL to delete the foreign key.

Sample :
ALTER TABLE "TEST_TABLE"
DROP CONSTRAINT "INTEG_78"

Drop Check Constraint

FireBird allows to drop an existing check constraint. After selecting the check constraint, DtSQL can generate and execute the SQL to delete the check constraint.

Sample :
ALTER TABLE
"TEST_TABLE"
DROP CONSTRAINT "TEST_CHECK"

Drop Unique Constraint

FireBird allows to drop an existing unique constraint. After selecting the unique constraint, DtSQL can generate and execute the SQL to delete the unique constraint.

Sample :
ALTER TABLE
"TEST_TABLE"
DROP CONSTRAINT "TEST_UNIQUE"

TOP
 

Procedure

Create Procedure

FireBird allows to create procedures. After entering the procedure name, parameter names and procedure body, DtSQL can generate and execute the SQL to create the procedure.

Sample :
CREATE OR ALTER PROCEDURE TEST_PROC
( PARAM1 VARCHAR(20), PARAM2 BIGINT )
RETURNS ( RETPARAM BIGINT )
AS
BEGIN
SELECT COUNT(*) FROM RDB$FILES INTO :RETPARAM;
END

Drop Procedure

FireBird allows to drop an existing procedure. After selecting the procedure, DtSQL can generate and execute the SQL to delete the procedure.

Sample : DROP PROCEDURE "TEST_PROC"

TOP
 

Sequence

Create Sequence

FireBird allows to create sequences. After entering the sequence name, DtSQL can generate and execute the SQL to create the sequence.

Sample : CREATE SEQUENCE "TEST_SEQ"

Drop Sequence

FireBird allows to drop an existing sequence. After selecting the sequence, DtSQL can generate and execute the SQL to delete the sequence.

Sample : DROP SEQUENCE "TEST_SEQ"

 

TOP

Copyright © DigerTech Inc