Solved

not execute all code

Posted on 2014-09-23
2
287 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

747 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

12 Experts available now in Live!

Get 1:1 Help Now