Autonomous transaction to the rescue

By Patch ~ August 25th, 2015. Filed under: Oracle, PL/SQL, SQL.

Today, at my current project, I came across an issue where autonomous transactions came in handy.

The situation: I need to create a query to perform an export. A couple of the fields to be selected come from a global temporary table, nothing fancy so far except this global temporary table is filled by a (rather complex) procedure. Another problem is this table is emptied for every row, i.e. it will contain only one row at a time. ‘Just build a wrapper table function for this procedure and have that function call the procedure’ was my first idea.

Continue reading »

What’s this ‘WHERE 1=1′?

By Patch ~ March 22nd, 2015. Filed under: Oracle, Plugins, SQL.

Since some time I have been adding WHERE 1=1 to all my queries.
I get queries like this:

  FROM emp e
 WHERE 1=1
   AND e.ename LIKE 'A%'
   AND e.deptno = 20

Lots of people ask me what’s the use of this WHERE 1=1.

Continue reading »

Write My Essay For Me Com

By Administrator ~ March 9th, 2015. Filed under: Uncategorized.

This write my essay for me com will allow you to recognize what technique you must decide to try tackle a marketplace that is more substantial. Third rate desires follow so forth, and second level ones. In regards to advertising his idea can be beneficial. While nearing a write my essay for me com person through a sales that is cool, nevertheless, you’ve extremely little details about them. The point will not be unaware of how you can help the consumer decide that your product is needed by them. Discuss the elements, activities, or family lifestyle - anything apart from the product you’re selling.

Continue reading »

Numeric sorting an alphanumeric column

By Patch ~ March 8th, 2015. Filed under: Oracle, SQL.

The other day a customer came up to me and said: I have this column that holds numeric data, usually. But when I sort it it gets all messed up, because is sorts it alphanumerically. That is 10 is listed before 2 etc.

My first suggestion was: well, sort by TO_NUMBER(column) then.

Well, he replied, that can’t be done. Sometimes the column contains alphanumeric data.

Continue reading »

Is it unique?

By Patch ~ October 5th, 2014. Filed under: Oracle, SQL.

The other day one of my colleagues said something like: ‘Hey, this is strange. Oracle is not working correctly’. My first thought is then: ‘well, you probably didn’t specify you requirements correctly’. What was the problem? A unique index was created on a table to implement a business rule which can be rephrased into ‘One-Manager-Per-Department’. This includes multiple columns where any combination is allowed, but only one manager is allowed per department.

Continue reading »

Our partners: writing essay company custom essay toronto custom essays liverpool