Questions tagged [oracle]
Oracle is a relational DBMS (Database Management System) created by Oracle Corporation.
76
questions
3
votes
2
answers
154
views
Clean up verbose code for Oracle SQL
I have the following Oracle SQL code that works, but I would like to try and find a way to clean it up so it's not so repetitive. It is looking at orders for a part ordered each FY in an Oracle ...
1
vote
1
answer
143
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 ...
0
votes
1
answer
64
views
0
votes
1
answer
53
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:
...
3
votes
3
answers
249
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 ...
1
vote
0
answers
624
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 ...
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 ...
1
vote
1
answer
36
views
Clubbing three queries that return mutually exclusive records
There is a table in Oracle database with the following data
...
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 ...
2
votes
3
answers
529
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 ...
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:
...
2
votes
2
answers
347
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, <...
2
votes
1
answer
548
views
Generating and storing a unique salt in Oracle database using Java
This is my account table:
...
0
votes
2
answers
117
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......
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:
...
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 ...
0
votes
2
answers
106
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.
...
1
vote
1
answer
238
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 ...
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 ...
1
vote
2
answers
10k
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?
<...
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 ...
4
votes
0
answers
111
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 ...
0
votes
1
answer
108
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 ...
1
vote
4
answers
90
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 ...
1
vote
1
answer
379
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 ...
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.
...
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 ...
2
votes
0
answers
422
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 ...
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 (<...
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 ...
5
votes
2
answers
86
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.
...
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 ...
1
vote
1
answer
41
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 ...
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 ...
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 ...
3
votes
1
answer
6k
views
Oracle SQL multiple count query
There is an Employee table with data like:
...
8
votes
1
answer
261
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 ...
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 ...
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 ...
4
votes
1
answer
124
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 ...
2
votes
1
answer
66
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.
...
0
votes
2
answers
118
views
Checking whether a grade combination exists
Below function checks if a grade exists
...
2
votes
1
answer
836
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:
...
8
votes
2
answers
227
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 ...
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 ...
3
votes
3
answers
493
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 ...
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 ...
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 ...
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:
...
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 ...