AskTom - Hot Questions

Subscribe to AskTom - Hot Questions feed AskTom - Hot Questions
These are the questions on Ask Tom that have the most comments
Updated: 19 min 41 sec ago

Oracle 11g select query with Json field

Thu, 04/02/2020 - 00:00
I want to fetch data from below table. Table Name: Insight <code>Id | Name | JSON_DATA ----+------------+------------------------------------------------------------- 1 | Sitansu. | {"country_codes": ["IND"], "regions": ["ASIA"]...

Uploading files in a Rest webservice using PlSql UTL_HTTP

Mon, 03/30/2020 - 00:00
Hi, I'm calling REST web services using PLSQL UTL_HTTP package, in JSON, with no problems. However, now i need to invoke a WS but attaching a file. I can do it with Postman in ?form-data? mode. In PLSQL, I've tried the same thing in the...

how to sum pivot query results

Fri, 03/13/2020 - 00:00
<code>with t1 as (select 'dfu1' dfu, 1 type, '01-Jan-2020' startdt, 10 period1, 20 period2, 30 period3, null period4, 50 period5 from dual union all select 'dfu1' dfu, 4 type, '01-Jan-2020' startdt, 1 period1, 2 period2, 3 period3, 4 period4, nul...

Stored procedure to truncate multiple tables not doing anything

Fri, 03/13/2020 - 00:00
Hello, I have written a stored procedure to truncate the multiple tables. When running the procedure no error but when checking by select statement still I can see that in the table. This means the procedure is not doing anything. Any help much ap...

Binding variables to dynamic SQL for a cursor

Thu, 03/12/2020 - 00:00
Looking at examples on I am trying to create a simple example of a procedure that returns a ref cursor and safely handles optional parameters. The two things I'm not clear on is how...

Partition strategy implementation

Thu, 03/05/2020 - 00:00
Hi Team, We have non partitioned Audit tables with billion of rows and now we are trying to partition those tables and archive them periodically . From your blog we understood that partition strategy should be purely based on data access and ma...

JPPD not occurring with nested UNION and/or row generation

Tue, 03/03/2020 - 00:00
Hello, I am faced with a performance issue with a sql in our application and am struggling to come up with ways to influence the optimizer to use JPPD. I have tried to simulate the setup as much as possible and can reproduce the issue on Livesql ...

Best way to check for existence based on last event date

Tue, 02/25/2020 - 00:00
Hello, I am trying to find out the best way to include a criteria in a sql to check is the latest event for a user has occurred before a specific date. Below is my table setup and brief description USER_NP => Parent table listing a...

Unable to load jar using dbms_java.loadjava in Oracle

Wed, 02/12/2020 - 00:00
I need to upload a jar file in Oracle RDBMS using dbms_java.loadjava method. I have granted all the required permission and able to run below function successfully. <code>create or replace function get_java_property(prop in varchar2) return varch...

LINESIZE and displaying data on a screen : the biggest part of execution time?

Wed, 02/12/2020 - 00:00
Hello Masters, I have one big question about the SQL*Plus parameter LINESIZE and the display of datas. I read in documentation Oracle 19 SQL*Plus :

Function for alphabetical sequence like a spreadsheet

Wed, 02/12/2020 - 00:00
I need function which convert numeric to alphabet like when I input 1 then it will return 'A', when i input 2 then it will return 'B' please help me on this.

Scheduling Queries

Mon, 02/10/2020 - 00:00
Hi Connor, Chris, Could you please have a look at below scenario related to dbms_scheduler program and job setu: <code> -------------- Start Use Case Setup -------------- -----------------------------------------------------------------------...


Mon, 02/03/2020 - 00:00
Below is my scenario. We are getting error randomly in production. when we restart the process error disappears. we are not able to reproduce even in lower environment. Can you please help in letting us know the potential issue with insert statement ...

Unpivoting billion rows

Thu, 01/23/2020 - 00:00
Hi ask Tom team, Hope you people are doing great in 2020. I am working in migration team ,our goal is to take csv file from client and ultimately transform data as per our production table structure . Requirement :- Recenty we have rec...

User Requiring Access to SQL Tuning Advisor Getting ORA-13616

Thu, 01/23/2020 - 00:00
Hi, we have created a User to manage the SQL Tuning Advisor. Due to internal policy /Guideline we created a Role and assigned the Role the following Oracle Privs : <code>Role Privs ------------------------------ PERF_OWN CREATE...

Calling executable from Scheduler

Wed, 01/22/2020 - 00:00
<b></b><code></code><u></u>Hi Tom I have been trying to call an executable shell script placed on AIX 7.2 from Oracle 12.2 via following code: <code>BEGIN DBMS_SCHEDULER.create_job ( job_name => 'GEN_DAILY_CNT_FILE', job_typ...

99% wait time on SQL*Net more data to client

Tue, 01/21/2020 - 00:00
Hello Team, We are transferring 4 million records over the network and SQL*Net more data to client is 99%. We tried multiple drivers like ODBC, OLEDB , Oracle Drivers, QlikSense application Oracle drivers but the % didn't get reduced. We have ...

how to load XML file into oracle table and using XML query to get result

Sun, 01/19/2020 - 00:00
Hi Tom, I have XML file from Web Report. there are some error records in the file, it is difficult to find the error in XML file, I want to load this file into oracle table. then use XML query. below is sample file and expected result. This is fir...

Benchmark summary processing technique

Tue, 01/14/2020 - 00:00
I have a package that is responsible for processing data from Detail tables. <b>All query logic and other parameters that is used to process data is stored inside a table</b>, which acts as a configuration table (sample example of configuration table...

changing where clause using case statement

Tue, 01/14/2020 - 00:00
Hello Tom Is it possible to change the where condition (using case statement) based on certain variable? For example <code> var T varchar2(1) exec :T := 'E'; var E number; exec :E := 7788; var N varchar2(20) exec :N := 'MILLER'; sele...