<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Help Desk Geek - Help Desk Tips For IT Pros &#187; Roger Spears</title> <atom:link href="http://helpdeskgeek.com/author/rpsears/feed/" rel="self" type="application/rss+xml" /><link>http://helpdeskgeek.com</link> <description>Help Desk Geek is a blog for Discussions about help desk tips and how-to computer tips</description> <lastBuildDate>Sun, 20 May 2012 11:01:23 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>An Introduction to Oracle SQL Developer &#8211; Part V</title><link>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-v/</link> <comments>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-v/#comments</comments> <pubDate>Sat, 20 Mar 2010 11:37:45 +0000</pubDate> <dc:creator>Roger Spears</dc:creator> <category><![CDATA[Databases]]></category><guid
isPermaLink="false">http://helpdeskgeek.com/?p=5943</guid> <description><![CDATA[Welcome to the final installment of the Oracle SQL Developer series. In this post, we will discuss how to connect Oracle’s SQL Developer with Non-Oracle databases. Oracle’s SQL Developer application is a very powerful GUI interface for working with Oracle databases or as in the case with this post, just about any brand of database. [...]]]></description> <content:encoded><![CDATA[<p>Welcome to the final installment of the Oracle SQL Developer series. In this post, we will discuss how to connect Oracle’s SQL Developer with Non-Oracle databases. Oracle’s SQL Developer application is a very powerful GUI interface for working with Oracle databases or as in the case with this post, just about any brand of database. Working with SQL Developer’s GUI interface puts everything a click away.</p><p><strong> </strong></p><h4><strong>Preparation</strong></h4><p>As we stated in the previous posts, you will need to download Oracle’s SQL Developer application. It’s free, but you will have to create an Oracle.com account to actually download the software.</p><p>At the time of this post, the current version is 2.1 and is available at</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/software/products/sql/index.html" target="_blank">http://www.oracle.com/technology/software/products/sql/index.html</a>.</p><p>The software is available for several types of platforms. Also, since it’s based on Java, there is a download version that includes the proper JDK. Once you uncompress the zip file, SQL Developer is ready to be used. Find the sqldeveloper.exe file and double click it to get started.</p><p>You will also need the third party database driver for your Non-Oracle database. The third party database drivers for use with SQL Developer can be found on this website:</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/products/database/sql_developer/files/thirdparty.htm" target="_blank">http://www.oracle.com/technology/products/database/sql_developer/files/thirdparty.htm</a></p><p><strong> </strong></p><h4>Getting Started</h4><p>Once you have everything installed and are ready to proceed, launch SQL Developer. On the left hand side, in the connection explorer panel, click on the green plus sign to create a new connection. This should present you with the new connection wizard. Our new connection wizard looks something like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_012.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_01_thumb2.png" border="0" alt="image_01" width="504" height="341" /></a></p><p>As you can see, we have already clicked on the <strong>MySQL</strong> tab. SQL Developer has already provided the hostname and the port. Next you need to provide the <strong>Connection Name</strong>, <strong>Username</strong> and <strong>Password</strong> for your MySQL database.</p><p>These credentials can be from a user of the database or your database root account. Our advice is that you connect with a user’s credentials. Remember, once you have provided all of the information it’s always a good idea to click on the Test button to test your connection information. If all goes well, you should see Status: Success in the lower left area of the connection wizard.</p><p>We have connected to our MySQL database and clicked the plus sign next to our connection to reveal all of our MySQL databases. Here’s what our SQL Developer currently looks like:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_022.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_02_thumb2.png" border="0" alt="image_02" width="504" height="307" /></a></p><h4><strong>Seeing Is Believing</strong></h4><p>If you have read the other posts in this series, I’m sure you realize by now that everything in SQL Developer is just a click away. So, to view the tables in a database, just click the plus sign next to the database name within the Connection explorer panel.</p><p>As you can see from the picture, we are viewing the list of <strong>procedures</strong> in our <strong>sakila</strong> database. You can also see the other database objects that are listed (functions, triggers, views and indexes).</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_032.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_03_thumb2.png" border="0" alt="image_03" width="252" height="531" /></a></p><p>Feel free to play around with the new connection and all of its “child” elements.</p><h4><strong>The Limits and Purpose</strong></h4><p>After reviewing the information available with your new non-Oracle database connection, you probably realized that several features are missing. In SQL Developer, Non-Oracle database connections offer you the ability to view, update, select, insert and delete data.</p><p>You can use SQL statements that are specific to the database type you are using. For example, in Oracle, if you wanted to limit the number of records returned with a statement your SQL syntax would look like this:</p><p><strong> </strong></p><p><strong>SELECT col FROM tbl WHERE ROWNUM&lt;=20;</strong></p><p>While you are connected to a MySQL database, you can use the typical MySQL syntax:</p><p><strong> </strong></p><p><strong>SELECT col FROM tbl LIMIT 20;</strong></p><p>Being able to use the native syntax for the database type you are using in Oracle’s SQL Developer is a big convenience.</p><p>The main purpose of connecting to non-Oracle databases with SQL Developer is the ability to migrate data from non-Oracle databases into Oracle databases. SQL Developer makes this process very simple. Under the <strong>Tools</strong> menu there is a choice titled <strong>Quick Migration</strong> and it uses a 6 step wizard to walk you through the migration process.</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_042.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_04_thumb2.png" border="0" alt="image_04" width="499" height="393" /></a></p><p>The other option is to migrate the data manually. The subject of migrating data is too lengthy for this post. In fact, it could be a series of its own. The manual process involves capturing data, converting it, massaging SQL scripts to your liking, running a few scripts and finally the actual migration of data.</p><p>For a more in depth reading in regards to SQL Developer and data migration, please visit the Oracle tech net page regarding SQL Developer and migrations:</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/tech/migration/workbench/files/omwb_getstarted.html" target="_blank">http://www.oracle.com/technology/tech/migration/workbench/files/omwb_getstarted.html</a></p><p><strong> </strong></p><h4><strong>Wrap It Up</strong></h4><p>In this post we covered how to connect to non-Oracle databases using the free Oracle SQL Developer application. We also covered a few topics regarding what you can do once you are connected. This series was meant to assist those performing Database Administrator (DBA) tasks but weren’t trained as DBA’s.</p><p>In this series we covered how to perform the following with SQL Developer, connect with Oracle databases, backup your data, create functions, connect with non-Oracle databases and one or two other tricks of the trade. We hope this series was as enjoyable for you as it was for us.</p><p>Thanks for reading, check out <a
href="http://helpdeskgeek.com">Help Desk Geek - Help Desk Tips For IT Pros</a> for more WordPress news!</p>]]></content:encoded> <wfw:commentRss>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-v/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>An Introduction to Oracle SQL Developer &#8211; Part IV</title><link>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iv/</link> <comments>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iv/#comments</comments> <pubDate>Fri, 19 Mar 2010 11:56:55 +0000</pubDate> <dc:creator>Roger Spears</dc:creator> <category><![CDATA[Databases]]></category><guid
isPermaLink="false">http://helpdeskgeek.com/?p=5808</guid> <description><![CDATA[Welcome back to our series introducing you to Oracle’s SQL Developer application. Check out Part I, Part II and Part III. In this post we are going to cover how to backup your data using SQL Developer. It’s a simple process involving a couple of clicks, menu choices and small amounts of typing. Backing up [...]]]></description> <content:encoded><![CDATA[<p>Welcome back to our series introducing you to Oracle’s SQL Developer application. Check out <a
href="http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial/" target="_blank">Part I</a>, <a
href="http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial-part-two/" target="_blank">Part II</a> and <a
href="http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iii/" target="_blank">Part III</a>. In this post we are going to cover how to backup your data using SQL Developer. It’s a simple process involving a couple of clicks, menu choices and small amounts of typing.</p><p>Backing up your database is an important task. With a proper backup of your data, you can feel confident in trying new concepts and statements with your database. Especially for those of us that “inherited” the duties of a Database Administrator (DBA), but were never trained as such.</p><h4><strong>Preparation</strong></h4><p>As we stated in the previous posts, you will need to download Oracle’s SQL Developer application. It’s free, but you will have to create an Oracle.com account to actually download the software.</p><p>At the time of this post, the current version is 2.1 and is available at</p><p><a
href="http://www.oracle.com/technology/software/products/sql/index.html">http://www.oracle.com/technology/software/products/sql/index.html</a>.</p><p>The software is available for several types of platforms. Also, since it’s based on Java, there is a download version that includes the proper JDK. Once you uncompress the zip file, SQL Developer is ready to be used. Find the sqldeveloper.exe file and double click it to get started.</p><p>There are three terms we should review before getting started with our main objective. The terms are <strong>data migration</strong>, <strong>data copy</strong> and <strong>data export</strong>. Although, in casual conversation, all three terms can be used to reference backing up a database, each term has a specific purpose. These three terms do not mean the same thing. The following is a brief description of what each term facilitates.</p><p><strong>Data Migration</strong></p><p>Data Migration is used when you want to migrate your data from a non-Oracle database (MySQL, MS SQL Server, MS Access and Sybase are a few examples) to an Oracle database. Data Migration usually consists of a three to four part process known as capture, map and migrate. Migration is not the same as backing up your database. Migration is the act of moving your database from one database technology to another.</p><p><strong> </strong></p><p><strong>Data Copy</strong></p><p>Data Copy is used when you want to create an exact copy of your database on the same server. For example, you can create a new connection to your Oracle database called “userdbbackup”. You could then connect with your normal SQL Developer connection and also connect with your new userdbbackup connection. Yes, you can have more than one connection open at a time.</p><p>Then you could use Data Copy to move EVERY THING from one connection to another. Essentially, Data Copy will copy one database to another database on the same server. The spirit of “backing up” is met with this action, but what if your server crashes? You could lose your database and the backup of your database at the same time.</p><p><strong> </strong></p><p><strong> </strong></p><p><strong>Data Export</strong></p><p>Data Export is the action that we want to work with in this post. Data Export will create an in depth Data Definition Language (DDL) document that you can save somewhere other than your database server.</p><p>You can think of this Data Export DDL file as a “snap shot” of your database at the time it was created.  In theory, you can copy/paste everything from the DDL file into an SQL Developer worksheet, click the <strong>Run Script</strong> button and recreate your database.</p><p><strong> </strong></p><h4><strong>Performing a Data Export</strong></h4><p>First you want to open SQL Developer and connect to the database you want to export. Next, choose <strong>Data Export</strong> from the <strong>Tools</strong> menu. A graphical representation of our steps so far looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_011.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_01_thumb1.png" border="0" alt="image_01" width="466" height="592" /></a></p><p>Upon choosing <strong>Database Export</strong> you will see the <strong>Export Wizard</strong>. As we describe each step, assume that we are using the <strong>Next </strong>button to transition to the next step.</p><p><strong>Step 1</strong> of the <strong>Export Wizard</strong> asks that you indicate the name of your export file and its save location. You also get several DDL options. For our purposes, we are sticking with the two default DDL options. Our Export Wizard step 1 looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_021.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_02_thumb1.png" border="0" alt="image_02" width="504" height="382" /></a></p><p><strong>Step 2</strong> of the <strong>Export Wizard</strong> asks that you indicate which types of database objects you want to include in the export. Because we are methodical IT types (aka Obsessive Compulsive), we want to export every type of object. Our Step 2 looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_031.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_03_thumb1.png" border="0" alt="image_03" width="504" height="382" /></a></p><p><strong> </strong></p><p><strong>Step 3</strong> of the <strong>Export Wizard</strong> asks that you specify which members of each type that you want to include in the export. The quickest method to include every member of every type is to first click on the Go button.</p><p>This will produce a list of every member of every type. Second, click on the blue double arrow button that is pointing to the right. This will move every member of every type into the right side column. Our version of step 3 looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_041.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_04_thumb1.png" border="0" alt="image_04" width="508" height="383" /></a></p><p><strong>Step 4</strong> of the Export Wizard asks that you specify which data you want included in the export file. Again, we want to include every piece of data. Therefore, click on the Go button again and then the blue double right arrow. Our step 4 looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_051.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_05_thumb1.png" border="0" alt="image_05" width="504" height="381" /></a></p><p><strong>Step 5</strong> of the <strong>Export Wizard</strong> will list a summary of your <strong>Export Wizard</strong> choices. Ours looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_061.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_06_thumb1.png" border="0" alt="image_06" width="504" height="380" /></a></p><p>Finally, we can click the <strong>Finish</strong> button.</p><p>As SQL Developer performs all of the tasks we just setup in the wizard, imagine several drum rolls and finally a cymbal crash sound as the DDL file opens within SQL Developer in its own tab. The imaginary drum rolls and cymbal sound isn’t necessary, but it enhances the wait time as SQL Developer performs our request.</p><p>Our DDL export file looks something like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_071.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_07_thumb1.png" border="0" alt="image_07" width="505" height="555" /></a></p><p>As you can see, the DDL export file is really just a long list of SQL statements that can be used to recreate everything in your database.</p><p>If we look in our designated export storage folder, we can see our new DDL file:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_08.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_08_thumb.png" border="0" alt="image_08" width="504" height="343" /></a></p><p>If catastrophe strikes, you now have a backup of your database. If you need to rebuild your database, you can import the export file with just a few clicks in SQL Developer.</p><h4><strong>Wrap It Up</strong></h4><p>In this post we covered a few terms related to your Oracle data and backups. We also covered how to create a simple export of your database for use as a backup in case of catastrophe. You might want to consider creating these exports and backups at regular intervals.</p><p>Stay tuned for our next and final post in this series where we discuss using SQL Developer with other database products (MySQL). I, for one, am giddy with just the thought…</p><p>Thanks for reading, check out <a
href="http://helpdeskgeek.com">Help Desk Geek - Help Desk Tips For IT Pros</a> for more WordPress news!</p>]]></content:encoded> <wfw:commentRss>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iv/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>An Introduction to Oracle SQL Developer &#8211; Part III</title><link>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iii/</link> <comments>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iii/#comments</comments> <pubDate>Thu, 18 Mar 2010 11:29:14 +0000</pubDate> <dc:creator>Roger Spears</dc:creator> <category><![CDATA[Databases]]></category><guid
isPermaLink="false">http://helpdeskgeek.com/?p=5766</guid> <description><![CDATA[Welcome to the next installment of this Oracle SQL Developer series. You can check out Part I and Part II here. In this post, we will cover the creation of a database function using Oracle’s free SQL Developer application. Oracle’s SQL Developer application is a very powerful GUI interface for working with Oracle databases. SQL [...]]]></description> <content:encoded><![CDATA[<p>Welcome to the next installment of this Oracle SQL Developer series. You can check out <a
href="http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial/" target="_blank">Part I</a> and <a
href="http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial-part-two/" target="_blank">Part II</a> here. In this post, we will cover the creation of a database function using Oracle’s free SQL Developer application.</p><p>Oracle’s SQL Developer application is a very powerful GUI interface for working with Oracle databases. SQL Developer makes those of us that are not classically trained Database Administrators (DBA’s) look like we know what we are doing.</p><h4>Preparation</h4><p>As we stated in the previous posts, you will need to download Oracle’s SQL Developer application. It’s free, but you will have to create an Oracle.com account to actually download the software.</p><p>At the time of this post, the current version is 2.1 and is available at</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/software/products/sql/index.html" target="_blank">http://www.oracle.com/technology/software/products/sql/index.html</a>.</p><p>The software is available for several types of platforms. Also, since it’s based on Java, there is a download version that includes the proper JDK. Once you uncompress the zip file, SQL Developer is ready to be used. Find the sqldeveloper.exe file and double click it to get started.</p><p>For this post we are also going to use Oracle’s HR example database that is packaged with Oracle 10g Express Edition. If you want to run Oracle 10g Express Edition, you can download it here:</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/products/database/xe/index.html" target="_blank">http://www.oracle.com/technology/products/database/xe/index.html</a>.</p><p>If you want a simple sql file of the data we will be working with, you can <a
href="http://helpdeskgeek.com/wp-content/uploads/hrdb.sql" target="_blank">download it here</a>. Open the file, highlight and copy everything (Command-A on OS X or CTRL-A on Windows) and paste it into your SQL Developer worksheet. Next, you will want to run the pasted text as a “script”.</p><p>Click the<strong> Run Script</strong> button which looks like a piece of paper with a green arrow in front of it. The <strong>Run Script</strong> button is indicated with a red box in the following image:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_01.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_01_thumb.png" border="0" alt="image_01" width="295" height="184" /></a></p><p>If you were to use the <strong>Run Statement</strong> button which sits to the left of the <strong>Run Script</strong> button, you run the risk of only executing the last sql statement in the whole list of statements we just pasted into the worksheet. The <strong>Run Script</strong> button will run all statement listed in the worksheet.</p><p>Once you have ran all of the statements you just pasted into the worksheet, your Connection Explorer should look like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_02.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_02_thumb.png" border="0" alt="image_02" width="258" height="738" /></a></p><h4>Creating an Oracle Function Using SQL Developer</h4><p>We are going to create a function that calculates how much an increase in sales commission (percentage of yearly wage) for our sales staff would cost the company.</p><p>If everything works well, the function will accept a number that represents the percentage of yearly wage that we want to use as the increase value, the function will use that percentage and calculate how much each sales staff member would be receiving and then display it on the screen.</p><p>To get started, right click on <strong>Functions</strong> in the connection explorer and choose <strong>New Function</strong> from the drop down menu. Doing so should display the Create PL/SQL Function window. Ours looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_03.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_03_thumb.png" border="0" alt="image_03" width="395" height="395" /></a></p><p>As you can see, we have given our new function the name <strong>CalcPayIncreaseforSalesStaff</strong>. We have also chosen the data type of <strong>NUMBER</strong> for our return value.  We also created an input parameter for our function titled <strong>RAISEPERCENT. </strong>Our input parameter will be of data type <strong>NUMBER</strong> and its mode is <strong>IN</strong>.</p><p>Next, click on the <strong>OK</strong> button and you should be presented with the code tab of your new function. We added the math calculation to our function’s code. Our function now looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_04.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_04_thumb.png" border="0" alt="image_04" width="508" height="208" /></a></p><p>If you need to copy and paste the function code, here it is as text:</p><p><strong>create or replace</strong></p><p><strong>FUNCTION</strong> CALCPAYINCRESEFORSALESSTAFF( RAISEPERCENT <strong>IN NUMBER</strong>)</p><p><strong>RETURN NUMBER IS</strong> PayIncreaseCost <strong>number</strong>;</p><p>sumsal <strong>number</strong>;</p><p><strong>BEGIN</strong></p><p>&#8211; First we must gather the total amount of sales staff yearly salary</p><p>&#8211; We select the value into our sumsal variable</p><p><strong>SELECT sum</strong>(salary) <strong>INTO</strong> sumsal <strong>from</strong> employees <strong>where</strong> job_id <strong>like &#8216;SA_%&#8217;</strong>;</p><p>&#8211; Next we multiply sumsal by the percent we passed in as a parameter</p><p>&#8211; We are also selecting the result of the multiplacation into our return variable</p><p><strong>SELECT </strong>(sumsal * RAISEPERCENT) <strong>INTO</strong> PayIncreaseCost <strong>FROM</strong> DUAL;</p><p>&#8211; Next we return the result of our function</p><p><strong>RETURN</strong>(PayIncreaseCost);</p><p><strong>END</strong> CALCPAYINCRESEFORSALESSTAFF;</p><p>The final step in creating a stored function using Oracle’s SQL Developer is to compile the function code. You should first compile for debugging. This will alert you to any issues during the compile process. The <strong>Compile for Debug</strong> option can be found by clicking on the down arrow next to the icon that looks like a cogs or gears. Here’s what our compile choices look like:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_05.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_05_thumb.png" border="0" alt="image_05" width="482" height="169" /></a></p><p>If everything compiles correctly, you should see something like this in your <strong>Messages Log</strong> window:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_06.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_06_thumb.png" border="0" alt="image_06" width="245" height="153" /></a></p><p>If you don’t see any errors listed, you should go back and compile the function using the <strong>Compile</strong> command (not the <strong>Compile for Debug</strong> command).  You should also see the new function listed in the connection explorer panel under the <strong>Functions </strong>heading.</p><p>In the future, if you ever need to adjust your new function, all you have to do is right click on it in the connection explorer panel. After right clicking on our new function in the connection panel, we can see the following options:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_8.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_8_thumb.png" border="0" alt="image_8" width="474" height="582" /></a></p><p>One of the nice features of a powerful GUI for databases is the ability to right click and choose an option rather than typing text on a command line. Especially if you are not a full time DBA, who can remember all of those commands?</p><h4>Using Our New Function</h4><p>When working with MySQL we can run a stored function by simply typing <strong>SELECT functionName();</strong>. When working with Oracle, we must always use a <strong>FROM</strong> clause in <strong>SELECT</strong> statements. For example, in MySQL you can add 3 + 3 with the following command line statement:</p><p><strong>SELECT 3 + 3;</strong></p><p>When working with Oracle, the <strong>SELECT 3 + 3;</strong> statement throws a “<strong>FROM keyword not found where expected</strong>” error. The solution is to use the <strong>DUAL</strong> table.</p><p>Think of the <strong>DUAL</strong> table as a blank table, dummy table or logic table. When working with Oracle <strong>SELECT</strong> statements, use <strong>FROM DUAL</strong> whenever you need a table to meet the requirement of a “<strong>FROM keyword not found where expected</strong>” error. For example, in Oracle, the following statement will return the number 6 :</p><p><strong>SELECT 3 + 3 FROM DUAL;</strong></p><p>In order to use our new function, we must select it with the <strong>FROM DUAL</strong> clause. Using our SQL Developer SQL Worksheet, we have incorporated the <strong>FROM DUAL</strong> clause and ran our <strong>SELECT</strong> statement.  Having passed .02 as our parameter for the amount of a raise, we can see that a 2% increase in payroll budget for the sales staff would cost the company $6,230. Our worksheet looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_07.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/03/image_07_thumb.png" border="0" alt="image_07" width="424" height="218" /></a></p><p><strong> </strong></p><h4><strong>Wrap It Up</strong></h4><p>In this post we covered how to create a stored function using Oracle’s free SQL Developer application. We also covered a necessary clause in Oracle for <strong>SELECT</strong> statements that really have no logical table.</p><p>The example we provided was really simple. Feel free to let your non-DBA imagination run wild and create the stored functions that you need. Also, stay tuned for future segments of this series.</p><p>In the future we will cover backing up your database using Oracle’s SQL Developer, the “Holy Grail” of using SQL Developer (connecting to MySQL tables) and any other topics that you might request between now and then.</p><p>Thanks for reading, check out <a
href="http://helpdeskgeek.com">Help Desk Geek - Help Desk Tips For IT Pros</a> for more WordPress news!</p>]]></content:encoded> <wfw:commentRss>http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-iii/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>An Introduction to Oracle SQL Developer &#8211; Part II</title><link>http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial-part-two/</link> <comments>http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial-part-two/#comments</comments> <pubDate>Tue, 02 Mar 2010 11:15:45 +0000</pubDate> <dc:creator>Roger Spears</dc:creator> <category><![CDATA[Databases]]></category><guid
isPermaLink="false">http://helpdeskgeek.com/?p=5623</guid> <description><![CDATA[Welcome to part two of this several part series regarding Oracle’s SQL Developer application. SQL Developer is a wonderful GUI application that lets us non-Database Administrators (DBA’s) interact with Oracle databases. SQL Developer turns the intimidating command line DBA tasks into simple point and click actions. For those of you that are familiar with MySQL [...]]]></description> <content:encoded><![CDATA[<p>Welcome to part two of this several part series regarding Oracle’s SQL Developer application. SQL Developer is a wonderful GUI application that lets us non-Database Administrators (DBA’s) interact with Oracle databases. SQL Developer turns the intimidating command line DBA tasks into simple point and click actions.</p><p>For those of you that are familiar with MySQL and have recently started working with Oracle, you might be frustrated with the fact that Oracle doesn’t offer an auto-increment field attribute.</p><p>Most Oracle DBA’s would argue if you setup your table correctly, you don’t need auto-increment attributes. We’re not going to enter the debate of what is right or what is wrong. We are simply going to offer you a solution.</p><p>In this post, using SQL Developer, we are going to create a trigger and a sequence that are tied to insert statements on a specific table. When you insert a new row into the table, the trigger will grab the next number from the sequence and place it into the ID field. When we are finished, you will have an Oracle table with a column that has a custom made auto-increment attribute.</p><h4><strong>Preparation</strong></h4><p>As we stated in the previous post, you will need to download Oracle’s SQL Developer application. It’s free, but you will have to create an Oracle.com account to actually download the software.</p><p>At the time of this post, the current version is 2.1 and is available at</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/software/products/sql/index.html" target="_blank">http://www.oracle.com/technology/software/products/sql/index.html</a></p><p>The software is available for several types of platforms. Also, since it’s based on Java, there’s a download version that includes the proper JDK. Once you uncompress the zip file, SQL Developer is ready to be used. Find the sqldeveloper.exe file and double click it to get started.</p><p>We are also going to need a new table. Our new table will be named <strong>FAV_BLOGS</strong>. <strong>FAV_BLOGS</strong> will consist of two fields. The first field will be an ID number (<strong>FAV_BLOGS_ID</strong>) and the second field will contain the name of your favorite blogs (<strong>FAV_BLOGS_NAME</strong>).</p><p>We will not populate this new table until the end of this post. We don’t want to add data to the table until we have setup our sequence and trigger. Feel free to setup our new table using SQL Developer and the methods discussed in part one of this series. For those of you that want to copy and paste code into the SQL Worksheet to create the new table, the code looks like this:</p><p><strong>CREATE TABLE &#8220;FAV_BLOGS&#8221;</strong></p><p><strong>(&#8220;FAV_BLOG_ID&#8221; NUMBER(12,0) NOT NULL ENABLE, </strong></p><p><strong>&#8220;FAV_BLOG_NAME&#8221; VARCHAR2(255 BYTE) NOT NULL ENABLE, </strong></p><p><strong>CONSTRAINT &#8220;FAV_BLOGS_PK&#8221; PRIMARY KEY (&#8220;FAV_BLOG_ID&#8221;));</strong></p><p><strong> </strong></p><h4><strong>The Sequence</strong></h4><p>In Oracle databases, a sequence can be used to generate a series of numbers. Assuming you are already logged into an SQL Developer connection, you can create a sequence by clicking on the arrow next to the word <strong>Tables</strong> under your connection name in the <strong>Connection Explorer</strong> along the left hand side.</p><p>In the list that appears under <strong>Tables</strong>, right click on <strong>Sequence </strong>and choose <strong>New Sequence</strong>. Fill out the <strong>Create Database Sequence</strong> window that appears. Ours looks like this after we fill in the fields:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_014.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_01_thumb4.png" border="0" alt="image_01" width="510" height="528" /></a></p><p>The <strong>Schema</strong> field should automatically populate with the correct information. You must supply a name for the sequence you are creating. As you can tell, we are using the name <strong>SEQ_FAV_BLOGS_ID</strong>. Under the <strong>Properties</strong> tab, you need to supply information regarding the particulars of this sequence. The definition of each field is as follows:</p><p><strong>Increment</strong> – How much should the ID number increment with each insert statement?</p><p><strong>Start With</strong> – What number should the sequence use for the very first insert statement?</p><p><strong>Min Value</strong> – What is the minimum value the sequence should allow?</p><p><strong>Max Value</strong> – What is the maximum value the sequence should allow?</p><p>The <strong>Cache, Cycle and Order</strong> settings for the sequence deserve a more in depth discussion. If you set the <strong>Cache</strong> option to <strong>CACHE</strong>, the sequence will be quicker and more efficient. For small tables this doesn’t matter, but if your table is going to have thousands of rows, you will want to use <strong>CACHE</strong>.</p><p>When the trigger invokes the sequence, the sequence looks for the next number to use. If you are using CACHE, Oracle won’t have to update the root file until it exhausts the cache size. For our example sequence, the root file won’t have to update until 50 calls to the sequence have successfully completed.</p><p>The larger the <strong>Cache size</strong>, the fewer times your database root file will update. If you use <strong>NO CACHE</strong>, every time the sequence is called, the root file for your database must update.</p><p>The <strong>Cycle</strong> option determines what happens if the sequence reaches the <strong>Max value</strong>. If you choose not to use <strong>Cycle</strong>, the next call to your sequence after the <strong>Max value</strong> has been used will cause an error to appear.</p><p>The error will state something to the effect of the next value for your sequence is not available. If you use the <strong>Cycle</strong> option, once the <strong>Max value</strong> you specify has been used, the next value returned by the sequence will start over with the <strong>Start with</strong> value you supply. Using <strong>Cycle</strong> will ruin your ID number uniqueness at some point in the future.</p><p>The <strong>Order</strong> option coordinates the next value used in your sequence across many sessions. This is achieved by forcing a single cache across all sessions for this sequence. Each call to your sequence will lock the sequence session while retrieving the next value. <strong>NOORDER</strong> uses a per session local cache. There is no lock synchronization with <strong>NOORDER</strong>. <strong>ORDER</strong> and <strong>NOORDER</strong> are useless if you do not use the <strong>CACHE</strong> option.</p><p>If you successfully create your sequence it should appear under the word <strong>Sequence </strong>in the Connection Explorer on the left hand side. Our <strong>Connection Explorer</strong> looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/clip_image002.jpg"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/clip_image002_thumb.jpg" border="0" alt="clip_image002" width="237" height="540" /></a></p><h4><strong>The Trigger</strong></h4><p>In Oracle databases, a trigger can be used to perform a list of “code” when a specific statement event occurs. For example, we are going to call a trigger every time an <strong>INSERT</strong> statement occurs involving our <strong>FAV_BLOGS</strong> table.</p><p>In your Connections Explorer panel along the left hand side of SQL Developer, right click on <strong>Triggers</strong> and choose <strong>New Trigger</strong>. Supply the specific information necessary for the Create New Trigger window. We have supplied the following information:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_035.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_03_thumb5.png" border="0" alt="image_03" width="510" height="365" /></a></p><p>The information we are providing is pretty basic. We are supplying <strong>TRIG_FOR_AI_FAV_BLOGS</strong> as the name of our trigger. We have chosen our trigger type as <strong>TABLE</strong> (because we want this trigger to occur when a specific table is accessed). We have check marked the <strong>Enabled</strong> option.</p><p>We have chosen the appropriate table owner. We have chosen the appropriate <strong>Table Name</strong>. We want our trigger to work on the INSERT command (check box). We want our trigger to occur BEFORE the INSERT command (radio button). Next, we want our trigger to occur at the row level (radio button). Finally, click the <strong>OK</strong> button.</p><p>If everything goes well, you should be presented with the code that is to be used in creating the trigger. It should look like this:</p><p><strong>CREATE OR REPLACE TRIGGER TRIG_FOR_AI_FAV_BLOGS </strong></p><p><strong>BEFORE INSERT ON FAV_BLOGS </strong></p><p><strong>FOR EACH ROW </strong></p><p><strong>BEGIN</strong></p><p><strong>NULL;</strong></p><p><strong>END;</strong></p><p><strong> </strong></p><p>In between BEGIN and END, you must remove the NULL statement and replace with <strong>SELECT SEQ_FAV_BLOGS_ID.nextval into :new.FAV_BLOG_ID from dual</strong>.</p><p>Our final trigger code looks like this:</p><p><strong>CREATE OR REPLACE TRIGGER TRIG_FOR_AI_FAV_BLOGS </strong></p><p><strong>BEFORE INSERT ON FAV_BLOGS </strong></p><p><strong>FOR EACH ROW </strong></p><p><strong>BEGIN</strong></p><p><strong>SELECT SEQ_FAV_BLOGS_ID.nextval into :new.FAV_BLOG_ID from dual;</strong></p><p><strong>END;</strong></p><p>Essentially, the trigger code is telling Oracle to CREATE the trigger and before any<strong> INSERT </strong>commands on the <strong>FAV_BLOGS</strong> table for every row and to <strong>SELECT </strong>the next value from our sequence and place it <strong>INTO</strong> any new <strong>FAV_BLOG_ID</strong> field being created.</p><p>That’s it. You have just created a custom auto-increment attribute for field in an Oracle table. Give it a test by inserting a couple of rows. Click on the table name in your <strong>Content Explorer</strong> and when the table tab opens next to the <strong>SQL Worksheet</strong> tab, click on the <strong>Data</strong> tab and fill in the <strong>FAV_BLOG_NAME</strong> field.</p><p>Leave the <strong>FAV_BLOG_ID</strong> field empty. Remember, you have to click on the <strong>Commit</strong> button in order to make the trigger run. The commit button looks like the flowchart symbol of a data base with a green check mark in front of it. After clicking on the <strong>Commit </strong>button, you should see your new row and the <strong>FAV_BLOG_ID</strong> field should automatically contain an incremental value.</p><h4><strong>Wrap Up</strong></h4><p>In this post, thanks to Oracle’s SQL Developer application, with a few short mouse clicks and a few key strokes we accomplished a somewhat advanced database task. As always, feel free to experiment with SQL Developer, triggers and sequences.</p><p>Also, stay tuned for the next post in this introduction series where we will cover creating stored functions with SQL Developer.</p><p>Thanks for reading, check out <a
href="http://helpdeskgeek.com">Help Desk Geek - Help Desk Tips For IT Pros</a> for more WordPress news!</p>]]></content:encoded> <wfw:commentRss>http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial-part-two/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>An Introduction to Oracle SQL Developer &#8211; Part I</title><link>http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial/</link> <comments>http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial/#comments</comments> <pubDate>Mon, 01 Mar 2010 11:37:43 +0000</pubDate> <dc:creator>Roger Spears</dc:creator> <category><![CDATA[Databases]]></category><guid
isPermaLink="false">http://helpdeskgeek.com/?p=5615</guid> <description><![CDATA[Although you might not be a Database Administrator (DBA), sometimes in the IT industry we have to perform tasks that really aren’t part of our training or job description. If you ever end up working with Oracle tables and would like to use a GUI to make your life easier, this series is for you. [...]]]></description> <content:encoded><![CDATA[<p>Although you might not be a Database Administrator (DBA), sometimes in the IT industry we have to perform tasks that really aren’t part of our training or job description. If you ever end up working with Oracle tables and would like to use a GUI to make your life easier, this series is for you.</p><p>Rather than double your daily dose of Doctor prescribed “IT Tic-Tacs”, just relax and read the rest of this post regarding a very simple, yet very powerful GUI for working with Oracle tables. We will start this series with the simple things and progress to the advanced topics that will really WOW your colleagues.</p><h4><strong>Preparation</strong></h4><p>You will need to download Oracle’s SQL Developer application. It’s free, but you will have to create an Oracle.com account to actually download the software. At the time of this post, the current version is 2.1 and is available at</p><p><a
rel="nofollow" href="http://www.oracle.com/technology/software/products/sql/index.html" target="_blank">http://www.oracle.com/technology/software/products/sql/index.html</a>.</p><p>The software is available for several types of platforms. Also, since it’s based on Java, there’s a download version that includes the proper JDK. Once you uncompress the zip file, SQL Developer is ready to be used. Find the sqldeveloper.exe file and double click it to get started.</p><h4><strong>Creating Connections</strong></h4><p>As you can see, upon launch you are presented with a Tip of the Day. You can choose to not have those displayed upon launch. Since we are working with a database GUI interface, we need to actually connect to a database. You will need to click on the green plus sign to add a new connection. The red arrow indicates the location of the green plus sign:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_024.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_02_thumb4.png" border="0" alt="image_02" width="510" height="344" /></a></p><p>We are going to connect to our Oracle 10g Express Edition database. You should use your own appropriate information for the Oracle install that you have. Our connection information looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_034.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_03_thumb4.png" border="0" alt="image_03" width="511" height="371" /></a></p><p>It’s advised that you use the <strong>Test</strong> button to make sure you can connect with your credentials and settings. If you are connecting to your corporate Oracle database server, you will probably use a service name instead of a <strong>SID</strong>.</p><p>Once you are connected you will see a list of your connections in the <strong>Connection Explorer</strong> along the left hand side. On the right, you will see a tab with the name of the connection.  This tab is the SQL Worksheet.</p><p>If you have multiple connections open, you will have multiple SQL Worksheets each with a tab denoting the connection name.  Right now we only have one connection, so our SQL Developer looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_044.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_04_thumb4.png" border="0" alt="image_04" width="511" height="261" /></a></p><h4><strong>Creating A New Table</strong></h4><p>Having a database with no tables is like having a sail boat with no sails.  One of the joys of using a database management GUI is how easy it is to perform tasks. Most tasks are point and click operations.</p><p>To create a table, you simply click the plus sign to the left of the connection name in the <strong>Connection Explorer</strong> panel and you should see a drop down menu like the one we have here:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_053.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_05_thumb3.png" border="0" alt="image_05" width="302" height="555" /></a></p><p>You want to right click on the Tables folder right below the connection name located in the <strong>Connections Explorer</strong> panel. You should see a drop down menu where you can choose <strong>New Table</strong>. Our looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_063.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_06_thumb3.png" border="0" alt="image_06" width="310" height="417" /></a></p><p>Once you have clicked on New Table you will see the <strong>Create Table</strong> window. We are creating a simple 3 column table with id, first name and last name for columns. Our <strong>Create Table</strong> window looks like this right before we click the OK button:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_073.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_07_thumb3.png" border="0" alt="image_07" width="510" height="366" /></a></p><p>At this point, under the <strong>Tables</strong> folder in the <strong>Connection Explorer</strong>, you should see the new table that we just created. Clicking the plus sign to the left of the new table listed in the <strong>Connection Explorer</strong> will display a tab next to the <strong>SQL Worksheet</strong> that lists a lot of details about the table. Our table tab looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_083.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_08_thumb3.png" border="0" alt="image_08" width="510" height="173" /></a></p><p>As you can see, there is a lot of information presented along with a lot of options. Let’s add a row to our table. Click the <strong>Data</strong> tab under the table name tab. You will be presented with something similar to this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_091.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_09_thumb1.png" border="0" alt="image_09" width="305" height="136" /></a></p><p>A great thing about SQL Developer is that you can type right in the empty fields. We have supplied the following information as the first row of our table:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_10.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_10_thumb.png" border="0" alt="image_10" width="382" height="122" /></a></p><p>At this point, to save our new row, we must click on the commit button. The <strong>Commit</strong> button is the database symbol with a green checkmark in front of it. Once you click the commit button, <strong>SQL Developer</strong> will display information regarding the operation you are committing.</p><p>It will display <strong>Commit Success</strong> or it will display and error number with an error description. For those of you that want to make sure everything is working, feel free to use the old school method of an SQL query.</p><p>Click on the <strong>SQL Worksheet</strong> tab, for us that’s <strong>DBTEST</strong> and type in a generic <strong>SELECT *</strong> query and click the green arrow that points to the right (the Run Statement button). You should see the row we just created in a <strong>Query Result</strong> window/tab that appears below the <strong>SQL Worksheet</strong>. Ours looks like this:</p><p><a
href="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_11.png"><img
style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://s.helpdeskgeek.com/wp-content/pictures/2010/02/image_11_thumb.png" border="0" alt="image_11" width="309" height="293" /></a></p><p>If you want to add more rows to your table, click the Customers tab that should still be visible, then click on the data tab and finally, click on the icon of a piece of paper with a green plus sign on top of it. This will provide an additional empty row that you can propagate with the new information. Again, don’t forget to click the Commit button.</p><p><strong> </strong></p><h4>Wrap Up</h4><p>This was the first post in a several post series regarding Oracle’s SQL Developer application. SQL Developer is free and it allows non-DBA’s access to databases via a GUI.</p><p>In this post we covered the basics of downloading and installing SQL Developer. We also covered how to create a table and how to add rows to a table.</p><p>Stay tuned for the next post in this series where we will cover how to get around one of Oracle’s policies about column attributes that always causes an argument between Oracle DBA’s and non-Oracle DBA’s. Good times!</p><p>Thanks for reading, check out <a
href="http://helpdeskgeek.com">Help Desk Geek - Help Desk Tips For IT Pros</a> for more WordPress news!</p>]]></content:encoded> <wfw:commentRss>http://helpdeskgeek.com/databases/oracle-sql-developer-tutorial/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 400/400 objects using disk: basic
Content Delivery Network via s.helpdeskgeek.com

Served from: helpdeskgeek.com @ 2012-05-21 01:05:53 -->
