Solved

not execute all code

Posted on 2014-09-23
2
301 Views
Last Modified: 2014-09-23
i am trying execute this query in pL/SQL
why is not execute all code? only execute
--TA_ANIO_EJERCICIO
CREATE TABLE TA_ANIO_EJERCICIO(
       idAnioEjercicio NUMBER(8) PRIMARY KEY,
       anio VARCHAR2(4) NOT NULL,
       CONSTRAINT UNQ_TA_ANIO_EJERCICIO
                  UNIQUE (anio)
);

CREATE SEQUENCE SEQ_idAnioEjercicio START WITH 1 INCREMENT BY 1;

CREATE OR REPLACE TRIGGER TGR_ANIO_EJERCICIO_INSERT
BEFORE INSERT ON TA_ANIO_EJERCICIO
FOR EACH ROW
BEGIN
    SELECT SEQ_idAnioEjercicio.Nextval into :new.idAnioEjercicio FROM DUAL;
END;
CREATE-TABLE.sql
0
Comment
Question by:enrique_aeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40340188
You need a '/' after the PL/SQL blocks.  I also like a show errors just in case.

CREATE OR REPLACE TRIGGER TGR_ANIO_EJERCICIO_INSERT
BEFORE INSERT ON TA_ANIO_EJERCICIO
FOR EACH ROW
BEGIN
    SELECT SEQ_idAnioEjercicio.Nextval into :new.idAnioEjercicio FROM DUAL;
END;
/

show errors
0
 
LVL 15

Expert Comment

by:Haris Djulic
ID: 40340189
Did you execute it as a script ?
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question