James Hambrick

Technology, Programming, and More

Navigation Menu

Show results from a SQL Union in order by a specific select statement

Posted by on Dec 11, 2014 | 0 comments

I came across an issue at work the other day and I could not find much help on how to accomplish it. So again I want to share it here for others to see. I needed to union a few SQL statements together. Oracle sorting the results by the first field was not helpful. , I wanted the results sorted in order of specific SQL statements. The solution I found that...

Read More

Oracle Greatest Function

Posted by on Nov 25, 2014 | 0 comments

I came across an issue the other day at work that I thought I could not solve without PL/SQL. I researched because I wanted to get the result using a SQL statement. My issue was that I needed to find the max value between two columns in Oracle. Here is an example...

Read More

Inner Join vs Outer Join

Inner Join vs Outer Join

Posted by on Feb 8, 2013 | 0 comments

Here I will show the difference between Inner Joins and Outer Joins hence the title Inner Join vs Outer Join. I have three tables to use for these examples. Table1: Customers CUSTID FNAME LNAME ST_ADDRESS CITY STATE HOME_PHONE EMAIL Table 2: Orders ORDID CUSTID PARTID QUANTITY Table 3: Parts PARTID NAME DESCRIPTION QUANTITY  Inner Join Vs Outer Join Inner...

Read More

Oracle Application Express Install

Oracle Application Express Install

Posted by on Jan 27, 2013 | 0 comments

In this post I will discuss the steps needed to install Oracle Application Express 4.2.1. First you need to make sure you have an Oracle DB installed on your computer. You can get a free version here. Oracle 11G Express Edition Here you need a login to the Oracle site. If you don’t have one don’t worry, it’s free to create one! Accept the...

Read More

Oracle Named Loops

Posted by on Jan 24, 2013 | 0 comments

When using nested loops in your PL/SQL code it is beneficial to use  Oracle named loops to make the code easier to read. To name a loop you simply add <<LOOP_NAME>> before the LOOP keyword, then add LOOP_NAME at the end of the END LOOP keyword as shown below <<MAIN_LOOP>> LOOP ...... END LOOP MAIN_LOOP;   Example using...

Read More

Oracle Sequence Nextval

Posted by on Jan 22, 2013 | 0 comments

Using Oracle sequence nextval you can autonumber a column in a table, that column is usually the primary key. This is useful if you want to increment that column with each new record. This way you do not have to know the max of that column before issuing an insert statement. Assuming the sequence is called CUSTOMER_SEQ and you are inserting a record into...

Read More