/*
Generado de esta forma:
$ isql -u sysdba -p masterkey -r sysdb -ex -o proyecto.sql d:\grchere\i189\pp\2019\PROYECTO.FDB

$ notepad proyecto.sql
*/
SET SQL DIALECT 3; 

/* CREATE DATABASE 'd:\grchere\i189\pp\2019\PROYECTO.FDB' PAGE_SIZE 4096 DEFAULT CHARACTER SET NONE */


/*  External Function declarations */
DECLARE EXTERNAL FUNCTION STRLEN
CSTRING(32767) CHARACTER SET NONE
RETURNS INTEGER BY VALUE 
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';


/*  Generators or sequences */
CREATE GENERATOR GEN_IDPRO;

/* Domain definitions */
CREATE DOMAIN DOM_CHARPK AS CHAR(20)
         CHECK (UPPER(VALUE) = VALUE AND STRLEN(VALUE) > 2) NOT NULL;
CREATE DOMAIN DOM_DESCR AS VARCHAR(100)
         CHECK (UPPER(VALUE) = VALUE AND STRLEN(VALUE) > 10) NOT NULL;
CREATE DOMAIN DOM_PK AS INTEGER
         DEFAULT 1
         CHECK (VALUE >= 1) NOT NULL;

/* Table: TBL_PRUEBA, Owner: SYSDBA */
CREATE TABLE TBL_PRUEBA (ID DOM_PK NOT NULL,
        DESCR DOM_DESCR,
CONSTRAINT TBL_PRUEBA_PK PRIMARY KEY (ID));
