×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Inexplicable exception upon create.

Inexplicable exception upon create.

Inexplicable exception upon create.

(OP)
Hi folks!

I am relatively new to SQL and Interbase 6 and need a bit of help.

I have the following code which works insofar as
(upon using the Interactive SQL in IBConsole of Interbase 6)
I can succesfully run the routine below.

It has the required result in that it won't allow me to enter
data into Tables PSWRD or PDCTS unless I already have something
in P_NO OF Table SAPARENT.

But I don't understand the significance of the following exception
which arises after running the Create routine.

Can someone throw some light on this please?

"Invalid request BLR at offset 21
generator PK_GEN_SAPARENT is not defined
Statement: CREATE TRIGGER PK_GEN_SAPARENT FOR SAPARENT
ACTIVE BEFORE INSERT POSITION 0
as
begin
 new.P_NO = gen_id(PK_GEN_SAPARENT, 1);
end"

Thanks in advance.

TERRY

RE: Inexplicable exception upon create.

(OP)
Sorry!  I ommited to put in the code which is as follows ...

CREATE DATABASE "C:\h\DataBase\SAPARENT.gdb" PAGE_SIZE 4096 user "SYSDBA" password "masterkey";
CREATE DOMAIN TNOTNULLID AS INTEGER NOT NULL;
CREATE DOMAIN TINT       AS INTEGER;
CREATE DOMAIN GEN25_M AS VARCHAR(25) NOT NULL;
CREATE DOMAIN GEN10 AS VARCHAR(10);

CREATE TABLE SaParent(
P_NO TNOTNULLID,
PNAME GEN25_M,
PRIMARY KEY (P_NO)
);
Commit Work;

CREATE TABLE PSWRDS(
 PW_NO TNOTNULLID,
 P_NO TNOTNULLID CONSTRAINT VALID_UID_IN_PSWRDS REFERENCES SAPARENT(P_NO),
 PW_NAME   GEN25,
PRIMARY KEY (PW_NO)
);
Commit Work;

CREATE TABLE PDCTS(
 PDCT_NO TNOTNULLID,
 P_NO TNOTNULLID CONSTRAINT VALID_UID_IN_PDCTS REFERENCES SAPARENT(P_NO),
 PDCT_NAME   GEN10,
PRIMARY KEY (PDCT_NO)
);
Commit Work;

SET TERM ^ ;

CREATE TRIGGER PK_GEN_SAPARENT FOR SAPARENT                      
ACTIVE BEFORE INSERT POSITION 0
as
begin
  new.P_NO = gen_id(PK_GEN_SAPARENT, 1);
end
 ^
CREATE TRIGGER PK_GEN_PSWRDS FOR PSWRDS                      
ACTIVE BEFORE INSERT POSITION 0
as
begin
  new.PW_NO = gen_id(PK_GEN_PSWRDS, 1);
end
 ^
CREATE TRIGGER PK_GEN_PDCTS FOR PDCTS                      
ACTIVE BEFORE INSERT POSITION 0
as
begin
  new.PDCT_NO = gen_id(PK_GEN_PDCTS, 1);
end
 ^
COMMIT WORK ^
SET TERM ; ^

SET BLOBDISPLAY 1;
SET TERM ;;
SET NAMES  ;
EXIT;
SET BLOBDISPLAY 1;
SET TERM ;;
SET NAMES  ;
EXIT;

The exception is

"Invalid request BLR at offset 21
generator PK_GEN_SAPARENT is not defined
Statement: CREATE TRIGGER PK_GEN_SAPARENT FOR SAPARENT
ACTIVE BEFORE INSERT POSITION 0
as
begin
 new.P_NO = gen_id(PK_GEN_SAPARENT, 1);
end"

Thanks in advance.

TERRY

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close