Skip to content
Advertisement

Tag: oracle

Insert if not exists Oracle

I need to be able to run an Oracle query which goes to insert a number of rows, but it also checks to see if a primary key exists and if it does, then it skips that insert. Something like: Is this at all possible with Oracle? Bonus points if you can tell me how to do this in PostgreSQL

Why use a JOIN clause versus a WHERE condition?

I develop against Oracle databases. When I need to manually write (not use an ORM like hibernate), I use a WHERE condition instead of a JOIN. for example (this is simplistic just to illustrate the style): I learned this style from an OLD oracle DBA. I have since learned that this is not standard SQL syntax. Other than being non-standard

SELECT SUM as field

Suppose i have this table table (a,b,c,d). Datatypes are not important. I want to do this select a as a1,b as b1,c as c1, (select sum(d) from table where a=a1 and b=b1) as total from table …

Oracle SQL escape character (for a ‘&’)

While attempting to execute SQL insert statements using Oracle SQL Developer I keep generating an “Enter substitution value” prompt: I’ve tried escaping the special character in the query using the ” above but I still can’t avoid the ampersand, ‘&’, causing a string substitution. Answer the & is the default value for DEFINE, which allows you to use substitution variables.

How to execute an .SQL script file using c#

I’m sure this question has been answered already, however I was unable to find an answer using the search tool. Using c# I’d like to run a .sql file. The sql file contains multiple sql statements, some of which are broken over multiple lines. I tried reading in the file and tried executing the file using ODP.NET … however I

Advertisement