Skip to main content
9 votes
Accepted

Build WHERE clause for search conditions

Sanitizer is a dangerous misnommer IMO. A better name could be NameQuoter, since that's what it does: it uses the RDBMS-specific ...
Mathieu Guindon's user avatar
5 votes

Build WHERE clause for search conditions

Just one thing... Use db-provider's sanitizer There is already a sanitizer that the DbCommandBuilder provides. You can use it like this: ...
t3chb0t's user avatar
  • 44.7k
4 votes
Accepted

File names to database table

folder = r'\\my\network\folder' subfolder_list = [r'\DRAWINGS', r'\DOCUMENTS', r'\VIDEOS'] Don't write the type into the variable name. The type should be able to ...
Raimund Krämer's user avatar
4 votes
Accepted

Generating and storing a unique salt in Oracle database using Java

Please use best practices in general when dealing with password hashing. If you have to verify the database for your generated salt to be unique, you're using a bad salt generator. Make sure to focus ...
dfhwze's user avatar
  • 14.2k
3 votes
Accepted

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

I know you say that I plan to use the view for multiple reports. So I've included all 265 columns in the view via select * but given the truly absurd column count in that table, I would consider a ...
Reinderien's user avatar
  • 71.1k
3 votes

Clubbing three queries that return mutually exclusive records

You can use aggregation like this: ...
RoToRa's user avatar
  • 11.6k
3 votes
Accepted

Clean up verbose code for Oracle SQL

tidy data Column names like FY17 or FY24 are not helpful. You want just a single FY column, which has values like 2017 or 2024 in different rows. Hadley Wickham describes the concept in some detail. ...
J_H's user avatar
  • 42.3k
2 votes
Accepted

Exception handling and releasing of OracleDB connection

There really isn't too much to say about your posted code. Answering your specific question: Yes, the connection will always be released as either your then or your catch method will always run. ...
Gerrit0's user avatar
  • 3,501
2 votes
Accepted

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

The first thing I would suggest is to avoid as much as possible depending on the DoCmd object. The DoCmd object is essentially ...
this's user avatar
  • 2,039
2 votes

Compare Oracle Table with SQL Server Table and Update/Insert

This code queries the SQL server 15K times (for each and every employee in the Oracle view). Suggest generating the SQL query based on the Oracle view data set and retrieve the data from SQL in one go ...
Christie's user avatar
  • 121
2 votes

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

I don't see you using std::, surely you didn't put using namespace std somewhere in your code right? I find your parameter ...
yuri's user avatar
  • 4,548
2 votes
Accepted

Calling an Oracle Stored Procedure with C# Code

I could see using it for the connection, command and reader since they implement IDisposable and the documentation for them does say to always call Dispose(). For the parameters it seems not only ...
Eric H's user avatar
  • 168
2 votes

Query for customer quotes by date range

I think the query is optimal enough. The truth is query can retrieve a result only by accessing 2 years data, so given WHERE condition is must. And the query access ...
kangbu's user avatar
  • 121
2 votes

Bulkloading xml's into Oracle table

As the ctl file can't be parameterized you'll have to create them for each infile. As it is quite small, I'd create it on the fly from a here string with the format operator. This sample script just ...
LotPings's user avatar
  • 338
2 votes

String manipulation over 2 tables in database to application

Even if I don't know the actual content, joining tables on client-side is basically a bad idea because you have to load the whole content to the client. As BCdotWEB mentioned in the comment, the ...
JanDotNet's user avatar
  • 8,608
2 votes
Accepted

Seek to get acceptable performance of SQL request (SOLVED)

The query plan seems to be too complicated because all_constraint is a view and not table. So it's difficult to derive what it's doing. But from common sense it ...
ichalov's user avatar
  • 36
2 votes

Updating a huge hashmap from a resultset

there was an issue with the code, I was obligated to add the SQLException to the method, since the code was not compiling otherwise. Before ...
Doi9t's user avatar
  • 3,374
2 votes
Accepted

capturing counts of open items between dates

In looking at your query, I think there may be a few things you can do to improve your performance. The first is that you can aggregate your ticket_table ahead of time based on the request interval. ...
Del's user avatar
  • 138
2 votes

Is this PL/SQL Stored proc optimal?

As mentioned, consider MERGE to handle the conditional INSERT and UPDATE actions. Doing so, ...
Parfait's user avatar
  • 980
1 vote

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

It looks like you are trying to get the cost of a work order including its children, if it has any, by joining from workorder nt to your in-line view ...
Preacher's user avatar
  • 111
1 vote

Updating a huge hashmap from a resultset

It is possible to join the queries into one query by having two separate queries on table1 that join on the primary key: ...
Sharon Ben Asher's user avatar
1 vote

Updating a huge hashmap from a resultset

My first question has to be: Why Java 7? If this is production code, then your environment urgently needs to be upgraded since 7 hasn't beeen supported by Oracle for over 5 years. And if this is just ...
RoToRa's user avatar
  • 11.6k
1 vote

Calculate the midpoint of a polyline

Check this function which returns the mid point X,Y in WKT format. Please note this function uses the SDO_LRS of Oracle which is part of Oracle Spatial. ...
Ashok Vanam's user avatar
1 vote

Calculate the midpoint of a polyline

I would recommend to try re-writing the procedure with Buffer and Centroid functions as below. procedure mindpoint (in_line_geometry) ...
Ashok Vanam's user avatar
1 vote

Bulkloading xml's into Oracle table

After looking back at it again, I realized I didn't need all those different dataFiles, as all those dataFiles hold only a ...
Ludisposed's user avatar
  • 11.8k
1 vote
Accepted

SQL Statement with a Select Statement Inside a Where Clause

Here is what I ended up with: ...
ADH's user avatar
  • 344
1 vote

Oracle SQL Code - Multiple Joins used

You open with SELECT DISTINCT . Is this really necessary? This is a performance killer. Perhaps duplicates can only occur between certain tables. If that were ...
dfhwze's user avatar
  • 14.2k
1 vote

Query for customer quotes by date range

To optimize this query, I would only perform the date checks once, regardless of how Oracle optimizes internally. ...
dfhwze's user avatar
  • 14.2k
1 vote

Calling an Oracle Stored Procedure with C# Code

...
t3chb0t's user avatar
  • 44.7k

Only top scored, non community-wiki answers of a minimum length are eligible