Solved

not execute all code

Posted on 2014-09-23
2
290 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
2 Comments
 
LVL 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now