SQL

There are 6 entries for the tag SQL
I’ve had a lot of feedback on my Oracle Update with Join post. The most common problem people have encountered with this approach is the dreaded “SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table”. Tom Kyte has a detailed explanation of this at Ask Tom. However, I thought I would take a moment to address my example scenario. There are actually a couple of ways to update based on data joined from multiple tables. The first is outlined in my first post. But, let’s ......
I attended the Houston TechFest today, and am now finding it difficult to sleep with all of the new knowledge and relationships filling my mind. I finally decided to get out of bed and put some of my thoughts in writing. The Fest was great. There are a few good reasons to attend an event like this. It's free. You get to meet new people with common interests. Employment opportunities are there if you are looking for them. You almost certainly learn something (if not many things). There are lot's of ......
[Update Oct ‘09 In response to a number of comments on this post regarding problems with this approach, I’ve added a new blog entry with more details. Check it out.] Those with a SqlServer background will be familiar with the UPDATE .. FROM syntax. For example (totally made up) 1: update employee_bonus 2: set bonus = 0 3: from employee_bonus b 4: inner join employees e on b.employee_id = e.employee_id 5: where e.bonus_eligible = 'N' Those who transitioned from SqlServer to Oracle might find the absence ......
I encountered a problem with Oracle's MERGE DML yesterday. What I was trying to do is use the "Upsert" feature of the merge, except with no distinct source. All of the searching I did for the MERGE showed examples of how to merge data from a source into a target. In my case, I thought the source and the target were the same. This is what I initially tried. It didn't work. It turns out that if the source (s) returns an empty set, then the merge is effectively a no-op 1: merge into MY_TARGET t 2: using ......

The Load event came to my rescue

Well, I have been playing with Linq, specifically with Oracle. First of all, the only way I could find to make this work is to use a third party software, OraDirect.Net by Core Lab. Their product is great. Perhaps that statement is biased by the fact that they are the only one's building a library to support Linq to Sql (as far as I know). There is certainly room for improvement. I've crashed VS a few times because I was trying to force OraDirect to do something it doesn't support. So, error handling ......