Arsip: Error waktu buat table di Interbase

 
user image
more 13 years ago

l1th1um

bos, sorry nih klo pertanyaannya nob banget. baru kali ini sih pake interbase ane eksekusi SQL keluar error kayak gini :
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 2, char -1
-CREATE
skrip databasenya kayak gini
CREATE DOMAIN DNAMA AS VARCHAR(80);
CREATE DOMAIN DKET AS VARCHAR(255);
CREATE DOMAIN DCF AS NUMERIC(4,2);
CREATE DOMAIN DOPL AS CHAR(1);
user image
more 13 years ago

mas_kofa


CREATE TABLE "DOMAIN"
(
   "DNAMA" VARCHAR(80) NOT NULL,
   "DKET"  VARCHAR(255),
   "DCF"   NUMERIC(4,2),
   "DOPL"   CHAR(1),
   PRIMARY KEY ("DNAMA")
);
user image
more 13 years ago

l1th1um

errornya jadi ini bos

Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, char 13
-"DOMAIN"
user image
more 13 years ago

l1th1um

en kayakny domain bukan nama table bos. ini lengkepnya

CREATE DATABASE " Ta.gdb" PAGE_SIZE 1024;
/ Domain definitions  /
CREATE DOMAIN DNAMA AS VARCHAR(80);
CREATE DOMAIN DKET AS VARCHAR(255);
CREATE DOMAIN DCF AS NUMERIC(4, 2);
CREATE DOMAIN DOPL AS CHAR(1);
/ Table: GEJALA, Owner: SYSDBA  /
CREATE TABLE GEJALA (NOGEJALA INTEGER NOT NULL,
        NAMAGEJALA DNAMA NOT NULL,
        KETERANGAN DKET  DEFAULT '',
UNIQUE (NOGEJALA),
PRIMARY KEY (NAMAGEJALA));
/ Table: SAWAN, Owner: SYSDBA  /
CREATE TABLE SAWAN (NOSAWAN INTEGER NOT NULL,
        NAMASAWAN DNAMA NOT NULL,
UNIQUE (NOSAWAN),
PRIMARY KEY (NAMASAWAN));
/ Table: EPILEPSI, Owner: SYSDBA  /
CREATE TABLE EPILEPSI (NOEPILEPSI INTEGER NOT NULL,
        NAMAEPILEPSI DNAMA NOT NULL,
UNIQUE (NOEPILEPSI),
PRIMARY KEY (NAMAEPILEPSI));
/ Table: NONEPILEPSI, Owner: SYSDBA  /
CREATE TABLE NONEPILEPSI (NONONEPILEPSI INTEGER NOT NULL,
        NAMANONEPILEPSI DNAMA NOT NULL,
UNIQUE (NONONEPILEPSI),
PRIMARY KEY (NAMANONEPILEPSI));
/ Table: LAIN, Owner: SYSDBA  /
CREATE TABLE LAIN (NOLAIN INTEGER NOT NULL,
        NAMALAIN DNAMA NOT NULL,
UNIQUE (NOLAIN),
PRIMARY KEY (NAMALAIN));
/ Table: OBAT, Owner: SYSDBA  /
CREATE TABLE OBAT (NOOBAT INTEGER NOT NULL,
        NAMAOBAT DNAMA NOT NULL,
        DOSIS DNAMA  DEFAULT '',
        ES1 DNAMA  DEFAULT '',
        ES2 DNAMA  DEFAULT '',
        LARANGAN DKET  DEFAULT '',
        HARGA DNAMA  DEFAULT '',
UNIQUE (NOOBAT),
PRIMARY KEY (NAMAOBAT));

/ Table: GEJALASAWAN, Owner: SYSDBA  /
CREATE TABLE GEJALASAWAN (RULE INTEGER NOT NULL,
        NOSAWAN INTEGER NOT NULL,
        CFSAWAN DCF  DEFAULT 1.00,
        NOGEJALA INTEGER NOT NULL,
PRIMARY KEY (RULE, NOGEJALA, NOSAWAN));
/ Table: PENYAKIT, Owner: SYSDBA  /
CREATE TABLE PENYAKIT (RULE INTEGER NOT NULL,
        NOEPILEPSI INTEGER NOT NULL,
        CFEPILEPSI DCF  DEFAULT 1.00,
        NOSAWAN INTEGER NOT NULL,
PRIMARY KEY (RULE, NOSAWAN, NOEPILEPSI));
/ Table: PENYAKITNONEPILEPSI, Owner: SYSDBA  /
CREATE TABLE PENYAKITNONEPILEPSI (RULE INTEGER NOT NULL,
        NONONEPILEPSI INTEGER NOT NULL,
        CFNONEPILEPSI DCF  DEFAULT 1.00,
        NOGEJALA INTEGER NOT NULL,
PRIMARY KEY (RULE, NOGEJALA, NONONEPILEPSI));
/ Table: FINAL, Owner: SYSDBA  /
CREATE TABLE FINAL (RULE INTEGER NOT NULL,
        NOEPILEPSI INTEGER NOT NULL,
        CFEPILEPSI DCF  DEFAULT 1.00,
        NOLAIN INTEGER NOT NULL,
        NILAI DNAMA  DEFAULT '',
        CFLAIN DCF  DEFAULT 1.00,
PRIMARY KEY (RULE, NOEPILEPSI, NOLAIN));
/ Table: FINALNONEPILEPSI, Owner: SYSDBA  /
CREATE TABLE FINALNONEPILEPSI (RULE INTEGER NOT NULL,
        NONONEPILEPSI INTEGER NOT NULL,
        CFNONEPILEPSI DCF  DEFAULT 1.00,
        NOLAIN INTEGER NOT NULL,
        NILAI DNAMA  DEFAULT '',
        CFLAIN DCF  DEFAULT 1.00,
PRIMARY KEY (RULE, NONONEPILEPSI, NOLAIN));
/ Table: TERAPI, Owner: SYSDBA  /
CREATE TABLE TERAPI (RULE INTEGER NOT NULL,
        NOOBAT INTEGER NOT NULL,
        NOEPILEPSI INTEGER,
        NONONEPILEPSI INTEGER,
        CFTOTAL1 DCF  DEFAULT 1.00,
        CFTOTAL2 DCF  DEFAULT 1.00);
/ Table: CEKGEJALA, Owner: SYSDBA  /
CREATE TABLE CEKGEJALA (NOGEJALA INTEGER NOT NULL,
        CFGEJALA DCF,
        JAWAB CHAR(1) DEFAULT '1',
PRIMARY KEY (NOGEJALA));
/ Table: CEKSAWAN, Owner: SYSDBA  /
CREATE TABLE CEKSAWAN (NOSAWAN INTEGER NOT NULL,
        CFSAWAN DCF,
        JAWAB CHAR(1) DEFAULT '1',
PRIMARY KEY (NOSAWAN));
/ Table: CEKLAIN, Owner: SYSDBA  /
CREATE TABLE CEKLAIN (NOLAIN INTEGER NOT NULL,
        CFLAIN DCF,
        JAWAB CHAR(1) DEFAULT '1',
        NILAI DNAMA NOT NULL,
PRIMARY KEY (NOLAIN, NILAI));
/ Table: HASIL, Owner: SYSDBA  /
CREATE TABLE HASIL (NOMOR INTEGER NOT NULL,
        NAMA DNAMA  default '',
        CF DCF  default 0,
        EPILEPSI CHAR(1) NOT NULL,
PRIMARY KEY (NOMOR, EPILEPSI));
ALTER TABLE GEJALASAWAN ADD FOREIGN KEY (NOSAWAN) 
REFERENCES SAWAN(NOSAWAN) 
ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE PENYAKIT ADD FOREIGN KEY (NOEPILEPSI) 
REFERENCES EPILEPSI(NOEPILEPSI) 
ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE PENYAKITNONEPILEPSI ADD FOREIGN KEY (NONONEPILEPSI) 
REFERENCES NONEPILEPSI(NONONEPILEPSI) 
ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE TERAPI ADD FOREIGN KEY (NOOBAT) 
REFERENCES OBAT(NOOBAT) 
ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE FINAL ADD FOREIGN KEY (NOEPILEPSI) 
REFERENCES EPILEPSI(NOEPILEPSI) 
ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE FINALNONEPILEPSI ADD FOREIGN KEY (NONONEPILEPSI) 
REFERENCES NONEPILEPSI(NONONEPILEPSI) 
ON UPDATE CASCADE ON DELETE CASCADE;
CREATE GENERATOR ID_GEJALA;
CREATE GENERATOR ID_SAWAN;
CREATE GENERATOR ID_EPILEPSI;
CREATE GENERATOR ID_NONEPILEPSI;
CREATE GENERATOR ID_OBAT;
CREATE GENERATOR ID_LAIN;
CREATE GENERATOR ID_LAINNONEPILEPSI;
CREATE GENERATOR ID_RULE;
SET TERM ^ ;

/ Triggers only will work for SQL triggers  /
CREATE TRIGGER HAPUSGEJALA FOR GEJALA                          
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM GEJALASAWAN G WHERE G.NOGEJALA = OLD.NOGEJALA;
END
 ^
CREATE TRIGGER HAPUSGEJALA1 FOR GEJALA                          
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM PENYAKITNONEPILEPSI P WHERE P.NOGEJALA = OLD.NOGEJALA;
END
 ^
CREATE TRIGGER HAPUSSAWAN FOR SAWAN                           
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM PENYAKIT P WHERE P.NOSAWAN = OLD.NOSAWAN;
END
 ^
CREATE TRIGGER HAPUSEPILEPSI FOR EPILEPSI                        
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM TERAPI T WHERE T.NOEPILEPSI = OLD.NOEPILEPSI;
END
 ^
CREATE TRIGGER HAPUSNONEPILEPSI FOR NONEPILEPSI                     
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM TERAPI T WHERE T.NONONEPILEPSI = OLD.NONONEPILEPSI;
END
 ^
CREATE TRIGGER HAPUSLAIN FOR LAIN                            
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM FINAL F WHERE F.NOLAIN = OLD.NOLAIN;
END
 ^
CREATE TRIGGER HAPUSLAIN1 FOR LAIN                            
ACTIVE BEFORE DELETE POSITION 0 
AS
BEGIN
  DELETE FROM FINALNONEPILEPSI F WHERE F.NOLAIN = OLD.NOLAIN;
END
 ^
COMMIT WORK ^
SET TERM ; ^
/ Grant permissions for this database  /
user image
more 13 years ago

herux

Satu -satu aja ... misal CREATE DOMAIN DNAMA AS VARCHAR(80); execute... trus.. CREATE DOMAIN DKET AS VARCHAR(255); execute...trus.. CREATE DOMAIN DCF AS NUMERIC(4,2); di commit dech.. u pake tool apa sih.. emang kadang kadang gitu.. biar jitu pake tool isql nya interbase langsung..!
user image
more 13 years ago

l1th1um

pake ISQL bos
user image
more 13 years ago

kasmaran83

klo relasi 1 ke 1 gimana ya codingnya;)
more ...
  • Pages:
  • 1
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com