oracle-sqldeveloper

How to select values within a column

最后都变了- 提交于 2019-12-12 00:19:59
问题 Apologies for sharing little information than needed. Should have provided the entire thing. Here's it. we are sending pre-check patching information from many DB's via a tool to some logs on another server, that server has the main DB which will store this info for comparing later on. We are using the tags "<>" to make our statements unique for identification. The logfile info will look like this: StepLog:Info: dbname instance_name hostname objnames and so on.. From the database on that

PL/SQL (How to calculate the first and last day of any quarter of any year)

巧了我就是萌 提交于 2019-12-11 19:44:06
问题 I have one table, per_all_peopl_f , with following columns: name person_id emp_flag effective_start_date effective_end_date DOJ -------------------------------------------------------------------------------- ABC 123 Y 30-MAR-2011 30-MAR-2013 10-FEB-2011 ABC 123 Y 24-FEB-2011 27-FEB-2011 10-FEB-2011 DEF 345 N 10-APR-2012 30-DEC-4712 15-SEP-2011 There are many entries (1000+) with repeated data and different effective start dates. I have to calculate the Workforce headcount. That is, the

Function Created with compilation errors in Oracle with table / view doesn't exist

僤鯓⒐⒋嵵緔 提交于 2019-12-11 19:07:05
问题 I have created a function which is working on my local but giving compilation error while creating on specific user and schema. I have verified the tables and this function executed in my local machine and returning the values. but when I tried to log in to other user and tries to create the function, it's giving compilation error. `/*Get_Accountdetails Functions*/ create or replace function Get_Accountdetails(inpstr1 in varchar2,inpstr2 in varchar2) return get_acnt_type as v_ret get_acnt

Unable to run dynamic query in stored procedure while selecting count of records

[亡魂溺海] 提交于 2019-12-11 18:51:11
问题 Hi I am trying to simply get the count of data in source table. CREATE OR REPLACE PROCEDURE MOVE_CHECK (SCHEMA_SOURCE IN VARCHAR2, SCHEMA_TARGET IN VARCHAR2, TABLE_SOURCE IN VARCHAR2, TABLE_TARGET IN VARCHAR2, COLUMN_SOURCE IN VARCHAR2, COLUMN_TARGET IN VARCHAR2) AS A VARCHAR2 (30); B VARCHAR2 (30); C VARCHAR2 (30); D VARCHAR2 (30); E VARCHAR2 (30); F VARCHAR2 (30); Count_source NUMBER (38); TEMP_1 VARCHAR2 (100); BEGIN A := SCHEMA_SOURCE; B := SCHEMA_TARGET; C := TABLE_SOURCE; D := TABLE

How to avoid 0 values using MIN and MAX function in SQL?

那年仲夏 提交于 2019-12-11 17:16:30
问题 I have table like this: Running Date 128 1/1/2018 700 6/11/2018 900 6/11/2018 300 6/11/2018 If same dates then pick minimum value and maximum value and get difference from "RUNNING" Column. If only one date then do nothing and get same value Query: SELECT MAX(RUNNING) - MIN(RUNNING) "RUNNING", DATE FROM TABLE GROUP BY DATE; I got following results: Running Date 0 1/1/2018 600 6/11/2018 But i want "128" value with "1/1/2018" date but this give 0 value How to solve this? 回答1: Include a CASE

What is the cause of this problem “IO Error: The Network Adapter could not establish the connection” on Sql Developer?

≡放荡痞女 提交于 2019-12-11 16:36:18
问题 I make a connection for connect to the Database Server (other machine). Then I found "An error was encountered performing the requested operation: IO Error: The Network Adapter could not establish the connection Vendor code 17002". Please look the picture in URL below. I tried to make a connection but can't access but my team can access it. My friend used TNS connection type and I did everthing similar him but can't access. I tried to use JDBC thin for connect but can't also. I had the old

numeric overflow with “NULL” column (0,3)

懵懂的女人 提交于 2019-12-11 16:12:04
问题 I have a table (Oracle 12.1.0.2.0) where when I sum up the values I get ORA-01426: numeric overflow 01426. 00000 - "numeric overflow" *Cause: Evaluation of an value expression causes an overflow/underflow. *Action: Reduce the operands. When I check the values in SQL-Developer I see in the column "NULL" which should be no issue for the function sum. When I use dump(col1) for this table the result is Typ=2 Len=2: 0,3 shouldn't this be NULL for columns with NULL? Also checks 'is not null' didn't

Java : Io exception: The Network Adapter could not establish the connection

£可爱£侵袭症+ 提交于 2019-12-11 15:28:55
问题 Currently i am trying to connect Oracle 11g database from tomcat server and i am getting following error : Caused by: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236) at oracle.jdbc.driver.T4CDriverExtension.getConnection

Audit operations with a trigger

杀马特。学长 韩版系。学妹 提交于 2019-12-11 14:52:54
问题 I have a trigger that fires in certain conditions, and when I update some data in EMPLOYEES table (specifically when inserting , deleting and updating comm_pct and salary ) the changes that were made are registered into the following table: CREATE TABLE "HR"."AUDIT_E" ("USR" VARCHAR2(30 BYTE) DEFAULT USER, "DATE" DATE DEFAULT SYSDATE, "DML_TYPE" VARCHAR2), -- UPDATE, INSERT, DELETE "OLD_EMPLOYEE_ID" NUMBER, "OLD_FIRST_NAME" VARCHAR2, ...,--more fields "OLD_JOB_ID" VARCHAR2, "OLD_SALARY"

Counting Items/Rows in DB as Columns Grouped by Another Column

不问归期 提交于 2019-12-11 14:33:55
问题 What I want to do is basically: select Type, (Count(*) where Date='')as 10/1, (Count(*) where Date='')as 10/2 from my table group by Type What I want it to look like is: Type 10/1 10/2 1 5 7 2 3 1 3 6 9 4 1 3 5 9 8 However, when I try to run a full select within each count column, I end up getting Type 10/1 10/2 1 12 15 2 12 15 3 12 15 4 12 15 5 12 15 Any suggestions are appreciated. I'm not sure if I will need to run a pivot or not, but I wouldn't think so. Additionally after I can run that