Skip to content
Advertisement

Tag: oracle

What happens to JOIN if no colums from said table are SELECT-ed?

I am wondering how Oracle, or how DB managers, work through longer scripts and bigger result. I will give an example and some questions below: Does the script run through all tables even though I don’t use them in the SELECT? Generally does this slow down the script execution if it brings back a lot of data? Answer Does the

PL/SQL table mutation and trigger Format

I just started with triggers, I want the trigger to give me the msg error if the new tauxHoraire is 50% greater than the current tauxHoraire (so *1.5 >). The trigger compiles but I’m getting ORA-04091: table name is mutating, trigger/function may not see it. There might a problem in how I wrote it. Or is the problem somewhere else?

How to get a SQL trigger to increment by 1 on an update?

I am trying to create a trigger that updates one column on a specific row when it is updated but I am getting this error ORA-04091: table table_name is mutating, trigger/function may not see it when I go to test the trigger. This is my trigger code: It is suppose to only update that certain Employees ID revisions Answer You

This Oracle SQL SELECT shouldn’t work. Why does it?

I am debugging a query in Oracle 19c that is trying to sort a SELECT DISTINCT result by a field not in the query. (Note: This is the wrong way to do it. Do not do this.) This query is trying to return a unique list of customer names sorted with the most recent sale date first. It returns an

Show column according to parameter

I’m trying to write a SQL script that shows a column based on a user parameter. I can’t find an acceptable answer anywhere.  This is a simplified version of what I want to do (in OracleDB): The pseudo code of what I want could be This is the expected result: Answer You can just put the logic into the where

pl/SQL for loop

i having an issue on changing the month according to the loop in where the clause i have used between function the month of todate function have to be changed according to the loop if a becomes 1 then the month in where clause has to be changed according to 1 if a becomes 2 the month have be changed

Oracle SQL Trigger not getting created

I have a table passenger as shown below I am learning triggers and I want to create a trigger that updates charges as charges + 100 before a new insert is done. Here is the trigger I created. However, I am getting the error ORA-04079: invalid trigger specification. I have tried replacing new with :new, adding begin & end blocks,

Find Guide who work on more than one tour on the same day

OUTING_ID TOUR_ID OUTING_START GUIDE 21000167 100345 30-APR-21 982354 21000168 100345 16-MAY-21 982354 21000170 100348 17-JUN-21 183476 21000200 100411 21-MAY-21 982354 21000202 100411 03-JUN-21 183476 21000205 100419 21-MAY-21 982354 21000207 100437 07-MAY-21 208655 Above define table describe the data of outing table. I need guide who are working on more than one tour on the same day. I need the below

Advertisement