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: 1 hour 54 min ago

How to hidden password of connect to oracle database someone user is needed in shell script file?

Tue, 06/13/2017 - 00:00
<code> ;;; Export: Release - Production on Tue Jun 13 04:00:02 2017 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. ;;; Connected to: Oracle Database 11g Enterprise Edition Release - 64bit Pr...

best way to derive deltas when there is nothing set up on source

Mon, 06/12/2017 - 00:00
We are looking at a gradual migration of a legacy system running on 11gR1. We do not have control over the source system (although their DBAs are willing to accommodate <i>small</i> requests we might have). The data model is being changed drastical...

Query to get the count of records every two hours

Wed, 06/07/2017 - 00:00
I have a record creation time stamp in my table . I need to write a query to get the count of records every two hours between two specific dates. Starting from 1st January 2017 till today. I have the following table USER USER_ID CREATION_D...


Fri, 05/19/2017 - 00:00
Hi, i read this below question in latest follow up a reader posted like this <code>( 5 years later... select * from X where rownum in (select 1 from dual) sti...

Toggle column value for alternate set of rows

Thu, 05/18/2017 - 00:00
Tom & team, I want to toggle the value in a column to 0 or 1 for alternate set of rows, can you please let me know the optimal way to accomplish this? select empno,dept.deptno, 0 counter from emp, dept where emp.deptno = dept.deptno orde...

Question on materialized view when concatenating several columns as a new column - cannot REFRESH FAST ON COMMIT

Mon, 05/08/2017 - 00:00
There is an error when my view is when concatenating several columns as a new column, it cannot REFRESH FAST ON COMMIT. CREATE MATERIALIZED VIEW LOG ON EXP_DC_HST WITH SEQUENCE, ROWID (ACTIVITY_DESCRIPTION, ACTIVITY_TYPE, CD1, CD2, CD3, CD4, C...

How to create tables automatically from multiple csv files in oracle database?

Mon, 05/08/2017 - 00:00
How to create tables automatically from multiple csv files in oracle database? For Example: I have a client requirement that load data from several csv files into an oracle database.I have 50 files with different ,i want create table ...

Show rows where the running total is zero and all preceding rows

Fri, 05/05/2017 - 00:00
Hi Team, Data Setup: <code>create table test_item as with t1 as ( select 1 category, 'abc' Item_name,100 item_volume,12.3 item_price,to_date('04-may-2017 12:22:33 AM','dd-mon-yyyy hh:mi:ss AM') time from dual union select 1,'abc' ,-100 ,1...

how the data stored in partition table

Thu, 05/04/2017 - 00:00
Hi Tom, I have a partition table, Range partition by date, list sub-partition by region. my question is: Is it possible that same day but different regions' data can be stored at same data block. when running complicated query (the query join a...

Find agents with no transactions for 5 or more continuous days

Wed, 05/03/2017 - 00:00
Table1: TRANSACTION FIELDS : AGENT_ID, TRNX_AMT, INSERTED_ON <code>create table TRANSACTION (AGENT_ID varchar2(10), TRN_AMT number(4,2),INSERTED_ON date);</code> Table2: AGENT_DETAILS FIELDS: AGNET_ID,NAME,STATUS <code>create table AGENT_DE...

Combining multiple rows with a "priority"

Wed, 05/03/2017 - 00:00
I have a table: <code>create table mytab (ROLE_NAME VARCHAR2(30), MENU_TAB VARCHAR2(20), colA VARCHAR2(1), colB VARCHAR2(1), colC VARCHAR2(1));</code> I populate: <code>INSERT INTO MYTAB VALUES('TECH','MAIN','A','B', NULL); INSERT INTO MYTA...