Skip to main content

Questions tagged [oracle]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
93 views

Spring Batch Item Writer Calling Stored Procedure

While migrating a Spring application to Spring Batch, I encountered a scenario where I need to process chunks of records from the database and invoke a stored procedure for each chunk. However, each ...
Vasanth's user avatar
  • 173
0 votes
1 answer
62 views

Is this PL/SQL Stored proc optimal?

...
Christian Bongiorno's user avatar
0 votes
1 answer
51 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: ...
ZygD's user avatar
  • 133
3 votes
3 answers
248 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 ...
User1974's user avatar
  • 198
1 vote
0 answers
556 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 ...
User1974's user avatar
  • 198
1 vote
1 answer
52 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 ...
born_naked's user avatar
1 vote
1 answer
35 views

Clubbing three queries that return mutually exclusive records

There is a table in Oracle database with the following data ...
Sara's user avatar
  • 151
4 votes
3 answers
3k 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 ...
Sara's user avatar
  • 151
2 votes
3 answers
490 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 ...
User1974's user avatar
  • 198
2 votes
1 answer
112 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: ...
user3341592's user avatar
2 votes
2 answers
337 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, <...
Aashish Upadhyay's user avatar
2 votes
1 answer
540 views

Generating and storing a unique salt in Oracle database using Java

This is my account table: ...
Lebron11's user avatar
  • 143
0 votes
2 answers
115 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......
Ludisposed's user avatar
  • 11.5k
2 votes
1 answer
47 views

String manipulation over 2 tables in database to application

I have the following function in the database to do string manipulation: ...
rcs's user avatar
  • 121
2 votes
0 answers
4k 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 ...
ADH's user avatar
  • 336
0 votes
2 answers
102 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. ...
ADH's user avatar
  • 336
1 vote
1 answer
219 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 ...
Matt Williams's user avatar
1 vote
2 answers
49 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 ...
ryvantage's user avatar
  • 111
1 vote
2 answers
9k 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? <...
ADH's user avatar
  • 336
2 votes
1 answer
1k 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 ...
Adrian's user avatar
  • 459
4 votes
0 answers
109 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 ...
kemri's user avatar
  • 41
0 votes
1 answer
107 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 ...
NJMR's user avatar
  • 161
1 vote
4 answers
89 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 ...
amallard's user avatar
  • 365
1 vote
1 answer
350 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 ...
User1974's 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. ...
user66875's user avatar
3 votes
1 answer
2k 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 ...
User1974's user avatar
  • 198
2 votes
0 answers
420 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 ...
Accollativo's user avatar
3 votes
2 answers
100 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 (<...
Cache Staheli's user avatar
7 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 ...
Grajdeanu Alex's user avatar
5 votes
2 answers
84 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. ...
Alexander's user avatar
  • 151
4 votes
1 answer
202 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 ...
Jonathan Watmough's user avatar
1 vote
1 answer
39 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 ...
Juneyoung Oh's user avatar
1 vote
1 answer
119 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 ...
MaMu's 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 ...
samer's user avatar
  • 23
3 votes
1 answer
6k views

Oracle SQL multiple count query

There is an Employee table with data like: ...
Abhishek Nayak's user avatar
8 votes
1 answer
257 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 ...
royskatt's user avatar
  • 203
1 vote
1 answer
131 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 ...
AM_Hawk's user avatar
  • 129
4 votes
1 answer
139 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 ...
SWard's user avatar
  • 143
4 votes
1 answer
121 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 ...
Dodi's user avatar
  • 43
2 votes
1 answer
65 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. ...
Caffeinated's user avatar
0 votes
2 answers
118 views

Checking whether a grade combination exists

Below function checks if a grade exists ...
sky's user avatar
  • 23
2 votes
1 answer
831 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: ...
null's user avatar
  • 205
8 votes
2 answers
225 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 ...
RubberDuck's user avatar
  • 30.8k
3 votes
1 answer
104 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 ...
PreguntonCojoneroCabrón's user avatar
3 votes
3 answers
491 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 ...
gloomy.penguin's user avatar
6 votes
2 answers
132 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 ...
200_success's user avatar
9 votes
2 answers
14k 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 ...
ΩmegaMan's user avatar
  • 244
6 votes
1 answer
64 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: ...
Michael McGriff's user avatar
2 votes
1 answer
616 views

Refactor Oracle Entity Framework lambda query

I had a ugly problem and wrote an ugly query. Query creates a cache that is used to get person id when I have {full_name, id_code?, birth_date?}. By question mark I mean that it is perfectly valid ...
Margus's user avatar
  • 914
1 vote
1 answer
372 views

Slow delete query on table with composite index

after profiling my application, it turns out that a single method is taking 3 minutes to run, which is about a third of the total runtime. The method deletes approx. 400.000 rows from each table (<...
l0r3nz4cc10's user avatar