I am creating a logical model on Oracle SQL, however am having a bit of trouble. When I add a relationship between two entities, I’d expect Oracle to add the PK of the parent entity to the child …
Tag: oracle
optimization select distinct query
How can i optimize this query, how to rewrite a request through exists: Answer Please use ANSI style join syntax, first of all. Now, Coming to your question, according to my knowledge NVL perform worse when working with large data sets. So how can we achieve the same functionality? — We can use DECODE o…
Need to create a Totals report from oracle table data
I have a table in oracle similar to the the example table image that I need to have output the segregated totals as shown in the second example results image. I need the sums of each item_type where A & B are just examples for a large number of possible items that can be added. example table: example resu…
How to print the cursor values in oracle?
I am new to oracle and I am learning cursors.My table City has two columns city_id,city_name.So,this is what I tried: i am trying to assign the data of cursor to the newly declared value v_list SYS_REFCURSOR;.But the output is coming as error at v_list := city_list;.How can I assign all the values of cursors …
How to generate the dynamic where condition in pl/sql cursor
Generate the dynamic where condition in pl/sql cursor based on input values For Example : Input Values : a b c values Query Format : CREATE OR REPLACE Procedure abcprocedure ( a IN Number,b …
Strange behavior of Oracle and group by
While analyzing performance of an SQL query in Oracle, I noticed a strange behavior. I noticed that Oracle’s plan behavior changes depending on value used in query. For example here is my table …
Oracle Selecting Index Optimisation
I need to optimise this query by using indexing. I tried to index some of the columns, but it is not helping. Is there anyone have thoughts? The query I need to optimise: Select vintage, wine_no, …
Is it possible to use GRANT inside a trigger in Oracle 18c?
I try to create a trigger which automatically grants select on all new tables for a specific schema, whenever a new table in this schema is created. Background for this is IBM InfoSphere Information …
How can an Oracle-user query a table in another schema in oracle18c?
I want the oracle-user c##user2 to query the table test in the schema c##user1, but when I query the table, I get the message “no rows selected”. Both users have the permissions “CREATE SESSION” and “…
How to create a table with all the table names in my DB and for each one, the number of columns in the table
I’m new at SQL developer so I don’t really know a lot about it. I am trying to obtain (from a select) a table with the names of all the tables in my DB with its number of columns. I have tried to do …