Skip to content

Tag: oracle

How to insert data into table even if trigger fails?

Oracle 11.1 I have custom logging table where I insert data: I have a trigger that runs on a specific table which does some checkings. My problem is: when the trigger fails, I want to be able to log some data into the log_table. Trigger: The following code doesn’t work. I tried to use EXECUTE IMMEDIATE maybe to force it,

Select the Max row number for an account

I need to only pull the max row number for an account. I know it’s a grouping issue. Current data: ACCOUNT_UID ID NAME ACADEMIC_PERIOD CAT_BY_DATE CAT_DATE MAX_ROW abc abc Popeye 202190 CPT 9/15/2021 1 abc abc Popeye 202190 CSH 10/4/2021 2 I only need the second row. Current query: Answer You can try the following: The idea is to apply

Why is cx_Oracle performing better than PHP OCI8?

I am trying to determine why a query that returns CLOB data runs so much faster using python3 and cx_Oracle in comparison to PHP 7.4 with OCI8. Oracle Client Libraries version is 19.5.0.0.0. Queries are ran on the same client and against the same database using the same user. See below for the test PHP and Python scripts. The PHP

How can i grant an execute statment

I want to grant TRIGGERS, FUNCTIONS and PROCEDURES to a role. I have the code to do it with procedure but with triggers and functions it not work. Answer User owns tables, functions and procedures. That user created a role and wanted to grant execute on various objects to the role. for triggers, it doesn’t make sense – they fire

PL/SQL CREATE PROCEDURE – Salary increase based on tenure

I have worked on this for a while but the code did not work and I could not figure out the correct solution. Did I miss something from the code? Thank you. — Question – The company wants to calculate the employees’ annual salary: –The first year of employment, the amount of salary is the base salary which is $10,000.

Find top parent of child, multiple levels

I make copies of the entries in some cases and they are conneted by parent ID. Each entry can have one copy: Sometimes I need to take a copy and query for it’s top level parent. I need to find the top parent entries for all the entries I search for. For example, if I query for the parents of

Query monitoring changes in the field

I need to program a query where I can see the changes that certain fields have undergone in a certain date period. Example: From the CAM_CONCEN table bring those records where the ACCOUNT_NUMBER undergoes a modification in the CONCTACT field in a period of 6 months before the date. I would be grateful if you can guide me. Answer You