?
Solved

not execute all code

Posted on 2014-09-23
2
Medium Priority
?
304 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 2000 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

Stack Overflow Podcast - Frustrating Miracles

In this podcast, Stack Overflow interviewed Linux Academy CEO/Founder, Anthony James, and got his developer story!

"Follow your passion, be prepared to work hard and sacrifice, and, above all, don't let anyone limit your dreams."  - Donovan Bailey

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

771 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