• 0
Sign in to follow this  
jacsonsoares

Script Interbase

Question

Pessoal é possível gerar dois comandos atravéz de uma query normal.

Ex.:

CREATE TABLE TB_TESTE
(
  CD_TESTE    INTEGER NOT NULL
 PRIMARY KEY (CD_ETIQUETAS)
);

CREATE GENERATOR SQ_CD_TESTE_TB_TESTE;

CREATE TRIGGER TG_TESTE FOR TB_TESTE
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
 IF (NEW.CD_ETIQUETAS IS NULL) THEN
   NEW.CD_ETIQUETAS = GEN_ID(SQ_CD_TESTE_TB_TESTE,1);
END

Obrigado a todos biggrin.gif

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this