Questions tagged [oracle]

Oracle is a relational DBMS (Database Management System) created by Oracle Corporation.

Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

Shortening Oracle SQL containing several unions

I believe the provided code can be rewritten shorter. Now one block is basically copy-pasted. In reality I have 6 such blocks. This would be the data: ...
user avatar
  • 133
3 votes
3 answers
157 views

Select non-task workorders, but include the costs of the tasks

IBM's Maximo Asset Management platform has a WORKORDER table (265 columns). Details: The WORKORDER table contains two different kinds of rows: WO records (istask = 0) Task records (istask = 1). The ...
user avatar
  • 198
1 vote
0 answers
92 views

Find junk values in all tables and columns

Find junk values in all tables and columns: Loop through all tables in a schema (Oracle 18c) Loop through each number and text column If columns have values that are junk, then add a statistic/record ...
user avatar
  • 198
1 vote
1 answer
42 views

capturing counts of open items between dates

DB version is: Oracle 12c. Restricted to the use of inline PL/SQL. The end goal here is to get a count of open items by day, inclusive of created date, exclusive of the end date. The data ...
user avatar
1 vote
1 answer
31 views

Clubbing three queries that return mutually exclusive records

There is a table in Oracle database with the following data ...
user avatar
  • 151
4 votes
3 answers
2k views

Updating a huge hashmap from a resultset

I am using Java 7 Problem: I need to retrieve records from a database table based on a condition, orig_setting = 1. This query could return ~1000 records. Parameters from 1-7 of the Params object are ...
user avatar
  • 151
2 votes
3 answers
318 views

Calculate the midpoint of a polyline

I have polylines in a GIS database. The polylines are stored using a user-defined type called ST_GEOMETRY. ST_GEOMETRY has lots of spatial functions. However, it does not have a polyline midpoint ...
user avatar
  • 198
0 votes
0 answers
41 views

Redundant query?

I have the following query: ...
user avatar
  • 111
2 votes
1 answer
105 views

Seek to get acceptable performance of SQL request (SOLVED)

Goal: I want to output all non-standard FK constraints from clients DB, versus our "standard" DB (which contains, by default, 2,631 FK). Trial: I wrote this code: ...
user avatar
2 votes
2 answers
257 views

Build WHERE clause for search conditions [closed]

Here is a set of classes that are used to build where clause for SQL Server and Oracle for different field types e.g. text, <...
user avatar
2 votes
1 answer
324 views

Generating and storing a unique salt in Oracle database using Java

This is my account table: ...
user avatar
  • 143
0 votes
2 answers
40 views

Bulkloading xml's into Oracle table

Intro We have some old(in my eyes) software at the place I work at the moment, Some stuff needs to be done manually, for instance we need to insert a XML file into a Oracle table, which will trigger......
user avatar
  • 11.4k
2 votes
1 answer
44 views

String manipulation over 2 tables in database to application

I have the following function in the database to do string manipulation: ...
user avatar
  • 121
2 votes
0 answers
3k views

Using Entity Framework to Call an Oracle Stored Procedure with Multiple Cursors

I wrote the following code to use Entity Framework 6 and Managed Oracle Providers to call an Oracle stored procedure that returns multiple cursors. Would like some input about the code I used to ...
user avatar
  • 336
0 votes
2 answers
100 views

SQL Statement with a Select Statement Inside a Where Clause

Is there a more efficient way to write the following PLSQL statement? It seems inefficient to me to have the SQL statement nested inside the where clause. ...
user avatar
  • 336
1 vote
1 answer
139 views

Oracle SQL Code - Multiple Joins used

I'm currently working on some SQL code within Oracle Fusion BIP but it's not very optimised as it's using multiple LEFT,RIGHT and FULL OUTER joins to link tables together. Unfortunately this is ...
user avatar
1 vote
2 answers
44 views

Query for customer quotes by date range

I have a table (Oracle): customer_quote ------ int id int part_key (fk) int condition_code (fk) number unit_price int qty_quoted date entry_date With a query ...
user avatar
  • 111
1 vote
2 answers
8k views

Calling an Oracle Stored Procedure with C# Code

I came across this code in a project I inherited. I am curious if all the nested using statements make sense to anyone else. Also, wondering if this code could not be written in a better/leaner way? <...
user avatar
  • 336
2 votes
1 answer
260 views

Database model for a hotel

I have to create a Hotel database according to these requirements: information about guests should be found, information about rooms divided into categories, reservations (ordered by a type of a room ...
user avatar
  • 459
4 votes
0 answers
107 views

Program to pull data from an Oracle database

EDIT: I should clarify that this program currently works as intended (not looking for help making it work); I just want to understand what I could have done better in terms of design. I work on a ...
user avatar
  • 41
1 vote
0 answers
67 views

Determining how many tabs to create and how many lines per each tab

I wrote this PL/SQL code for Oracle Apex, works perfectly. At the beginning I had more than 200 lines for the same code. I’m new and I’m still learning. After searching on multiple websites I found ...
user avatar
  • 119
0 votes
1 answer
84 views

Refactoring the legacy code which is using '§' char in the code

I have a legacy code (might be 20 years old) as shown below. Where they are using the non ASCII '§' char in the code. First they are preparing a ...
user avatar
  • 161
1 vote
4 answers
79 views

Select multiple count queries in single query

I currently have 6 very similar queries that I'm trying to increase performance on by making them all subqueries in 1 query. I'm not sure what is better performance wise, keeping them 6 separate ...
user avatar
  • 365
1 vote
1 answer
89 views

File names to database table

I have files in subfolders on a network drive. I want to create a list of files, and insert that list into an Oracle table. I can successfully iterate through the files in the subfolders and do the ...
user avatar
  • 198
0 votes
1 answer
2k views

Exception handling and releasing of OracleDB connection

Before I start implementing several REST API service endpoints, I'd like to make sure that I'm not doing it totally wrong. ...
user avatar
3 votes
1 answer
1k views

Update pass-through query from a form (an alternative to stored procedures)

I've adapted a script from the book Microsoft Access Developer's Guide to SQL Server that I use to update a pass-through query via a form. One way to pass parameters to a pass-through query is to ...
user avatar
  • 198
2 votes
0 answers
313 views

Calling PL/SQL functions using JDBC in a Spring clone

I started to modify some old code and ended up creating a sort of spring jdbc framework. I know just the most popular design pattern, so I was wondering if my design was good. For example, to call ...
user avatar
1 vote
0 answers
70 views

Given table of values, find rows that match a predicate

I'm working on the following problem: We have a Row Java type that roughly represents that of database table row (meaning it has a set of fields and is identified ...
user avatar
0 votes
0 answers
280 views

Using a boolean column as an index to process rows vs partitions or other mechanisms

I receive files from many sources (SFTP, REST, SOAP, etc.) in many formats (CSV, JSON, XML, etc.) and then process them at a later time in a ...
user avatar
3 votes
2 answers
94 views

Employee Compensations Query

I have a pretty straightforward query that I am essentially hard-coding. I have a table with 3 keys and a description field. The first key has to do with the type of compensation for an employee (<...
user avatar
6 votes
4 answers
1k views

Simple Oracle connection using JDBC

I'm trying to continue the learning process in Java, and I've made a simple yet useful class which will allow me to retrieve the data inside a table from an Oracle DB, using JDBC. What I'm especially ...
user avatar
5 votes
2 answers
79 views

Script for updating an Oracle database

I have the following piece of Perl script for updating an Oracle database. It's working perfectly fine, but I want to know how I can simplify this script. ...
user avatar
  • 151
4 votes
1 answer
179 views

Identify the installed Oracle driver, Scan the .NET GAC for Incompatible Assemblies

My day job is supporting a piece of software that just started using the DevArt Oracle drivers, which utilize the Oracle.DataAccess .NET drivers. However, the ...
user avatar
1 vote
1 answer
34 views

Check user changed his password recently or not in specific period

I am working on Oracle SQL. What I am trying to do is: Query a record with ID If the record does not exists use user input value If the record exists, compare ...
user avatar
1 vote
1 answer
110 views

Create multi-dim array from cursor

I'm executing a cursor. I have cut off the code how the procedure is called and executed. This part is efficient. At last I have a small cursor. I'm calling the procedure, which returns this cursor ...
user avatar
  • 235
1 vote
1 answer
4k views

Oracle trigger to keep a copy of deleted records in another table

I am using this trigger to keep a copy of the deleted record from table Orders_Details in table Orders_Details_Deleted. I am ...
user avatar
  • 23
3 votes
1 answer
5k views

Oracle SQL multiple count query

There is an Employee table with data like: ...
user avatar
8 votes
1 answer
213 views

Extract data from a DBMS, create a CSV dump and transfer it to an FTP server

First of all, my code does work as expected at least to some extent. The intention of the program is to extract data from a DBMS in order to create a CSV dump and transfer it to an FTP server. My two ...
user avatar
  • 203
1 vote
1 answer
123 views

Convert MS SQL datetime to Oracle varchar(32) interval

I have a query against an MS SQL database that takes the resulting dataset and stores it in an Oracle database table which then gets joined to another Oracle table using the column ...
user avatar
  • 129
4 votes
1 answer
136 views

Oracle Database Communication/Operation

I am creating an application that will move specific data from one Oracle database and moving it to a MySQL database. I created this class to help keep myself organized and this class holds all of the ...
user avatar
  • 143
4 votes
1 answer
117 views

Highest andLowest in PLSQL

I have made a procedure to display the highest and the lowest popular Items for a particular time of a given date. The procedure works with no errors or exceptions ...
user avatar
  • 43
2 votes
1 answer
61 views

Generating business summary stats in SQL dynamically, based on an inputted date

I have the following Oracle SQL query to generate some system-stats. I am interested in making it a more efficient and readable query. ...
user avatar
0 votes
2 answers
104 views

Checking whether a grade combination exists

Below function checks if a grade exists ...
user avatar
  • 23
1 vote
1 answer
789 views

Oracle query to split 1 row into two where conditions are applicable

The scenario question: "I'm having difficulties with splitting a single row into two individual ones." My test schema is: ...
user avatar
  • 195
8 votes
2 answers
224 views

Checking for Duplicates, Except

I have a query that returns records that have duplicate names within a given DBSTATUS. I used to do this with a direct connection to the remote oracle database ...
user avatar
  • 30.7k
3 votes
1 answer
101 views

Refactor (DRY, KISS) QueryStatus event for VS Addin

I have complex logic in QueryStatus event (CommandTarget) for a VS Addin (VS 2010). I'm a newbie using C#. I would like elegant, easily maintainable code that follows DRY and KISS principles. Maybe ...
user avatar
3 votes
3 answers
480 views

Counting business days in a month, ignoring holidays

This table simply contains date information. I went ahead and used what I currently have since this is a one-time operation. However, since I only recently started working with Oracle, I would like to ...
user avatar
6 votes
2 answers
128 views

Out of one Oracle into another

A project that I have been working on required data to be transferred from an Oracle database into MySQL. The process I devised for that transfer involved a query (included below) on the Oracle ...
user avatar
9 votes
2 answers
13k views

Filter out date records which don't fall within or span a date range

I have records which have specific time spans. The need is to select records which adhere to the following three rules (read them as or conditions) concerning a ...
user avatar
  • 244
6 votes
1 answer
62 views

Trying to avoid a double full scan with aggregates in query

I have a statistics query I'm trying to run against the below table: ...
user avatar