All Questions
335 questions
0
votes
2
answers
95
views
Oracle Trigger: Unable to Update Table Using Subquery or Variables
I am encountering an issue with an Oracle trigger where I am attempting to update a table based on a subquery result or a declared variable. The trigger is designed to execute before an update on the '...
2
votes
2
answers
203
views
Skipped error during the execution of trigger
I create a trigger on database event LOGON , to avoid someone without permission login to the database by mistake. When the host name start with C, it need to be reject to connect.
CREATE OR REPLACE ...
-1
votes
1
answer
35
views
How do I make a trigger that would check for eligibility in oracle?
create table Student
(studID char(4) PRIMARY KEY,
studName varchar2(20) NOT NULL,
studPhone varchar2(12) NOT NULL,
studElig char(1) NOT NULL);
create table Sports
(sportsID char(4) PRIMARY KEY,
...
0
votes
1
answer
130
views
Trigger adds a value with sequence CAN`T solve
I`m trying to solve a trigger issue. So I have to replace the value for every inserted row with new value from the sequence DEPARTMENTS_SEQ. And I ended up here
create or replace TRIGGER hr_insert_tr ...
0
votes
2
answers
190
views
When I insert into a table, how do I create a trigger such that the inserted numeric value is summed up in another table's column?
I have a table CabinCrew and another table Employee. The CabinCrew table, among other things, records the FlightHours of the crew for a particular flight.
CabinCrew(EmployeeID, FlightID, Hours)
...
0
votes
1
answer
44
views
After Insert Trigger sintax error - ORA-00922
There is a table which i want to update each row after inserted, when the user_type of my schedule table is a "superuser". I tried to convert the table/column names to "simplify", ...
0
votes
1
answer
921
views
Update a value of a column depending on another column's value. Inside a trigger
In this table,the variable "duration" can only be either 'A' or 'S' (i already established that with a CHECK CONSTRAINT, when I created the table). If the value of "duration" is 'A'...
0
votes
1
answer
60
views
How to get the main ID of updated row and use it before DML in trigger
I'm blocked with the development of an Oracle trigger (11g). The goal of the trigger is to store some data in an audit trail table. One of the fields that is populated in this table is an XML block ...
0
votes
2
answers
30
views
Cannot insert data in trigger
It give me error example image at below:
Trigger code:
CREATE OR REPLACE TRIGGER InsertNewStaffs
BEFORE INSERT ON Staffs
FOR EACH ROW
ENABLE
DECLARE
v_user varchar(255);
v_date varchar(255);
...
0
votes
1
answer
100
views
TRIGGER | FOR LOOP OR CURSOR USING FOR VARIABLE PL/SQL
I want to try insert loghis of table into one column for saving spaces
before Delete on SmtTable
for each row
declare
v_loghis SmtTable%rowtype;
v_tabVar varchar2(2000);
begin
v_loghis.empo := 'old' ...
0
votes
3
answers
65
views
How can I handle uniqueness in this situation?
I have a table like this:
create table my_table
(
type1 varchar2(10 char),
type2 varchar2(10 char)
);
I want to uniqueness like this;
if type1 column has 'GENERIC' value then just type2 column must ...
0
votes
1
answer
88
views
Trying to insert into table after rising the application error but its rollbacks
I am trying to make a Trigger to restrict the user to performing DDL on Saturday and Sunday but if someone tries to insert data it will save that that in the weekend_action table but also raise ...
0
votes
1
answer
50
views
unable to store the value of column in variable, SQL TRIGGERS
The booked_tickets table that I have created to store the info of the tickets
CREATE TABLE BOOKED_TICKETS(
PNR_NO NUMBER PRIMARY KEY,
USER_ID NUMBER,
TRAIN_NO NUMBER,
SOURCE VARCHAR2(50),
...
0
votes
2
answers
2k
views
Create trigger to update same table after insert
I need some help to automatically ignore some data (after insert) on the table in order for it not to process those records:
CREATE or REPLACE TRIGGER "user"."trigger_name"
AFTER ...
0
votes
2
answers
632
views
Can you refresh materialised view inside a trigger? Oracle 11g
Basically I have a Materialised View which needs to be refreshed once a month when a particular table, HISTORY_TABLE is updated i.e. HISTORY_TABLE is only inserted into c. once a month. The ...