Complete IT Professional http://www.completeitprofessional.com Helping Software Developers Get Ahead In Their Careers Mon, 27 Apr 2015 11:00:50 +0000 en-US hourly 1 http://wordpress.org/?v=4.2 How To Find The Path To Your Ideal Job In The IT Industryhttp://www.completeitprofessional.com/how-to-find-the-path-to-your-ideal-job/ http://www.completeitprofessional.com/how-to-find-the-path-to-your-ideal-job/#comments Mon, 27 Apr 2015 11:00:50 +0000 http://www.completeitprofessional.com/?p=3445 ]]> How To Find The Path To Your Ideal Job In The IT IndustryOne of the most popular questions that I’ve gotten on Complete IT Professional over the years is how do I become a <role>, where <role> is any kind of role in the IT industry. I’ve written a few articles on various roles, but this article will explain a method you can use for any role.

Getting in to the role that you want in your career can be challenging. You’ll need to know what the role is, then the steps needed to get there, and then do the work. Where do you get started? How do you get the role that you want in the IT industry?

Let’s take a look at the steps.

 

Decide On Your Ideal Role

The first step to getting the role that you want is to actually work out what it is that you want to do. This is easier said than done.

Do you know the job title of the role that you want to do? For example, you may want to become a Senior Software Engineer at a technology company. Or, you may want to become a Database Administrator in the finance industry.

If you know the job title, it helps, because we’ll use that in the next step.

If you’re not sure of the job title, do you know anyone who is in the position you’d like to be in? For example, a co-worker, or someone from a book you’ve read?

Write this down somewhere. You’ll use it in the next step.

 

Search LinkedIn For That Job Title

Once you have your job title, it’s time to pay a visit to LinkedIn.

If you don’t have a profile already, I highly recommend setting one up. It’s great for your career.

Assuming you have one already, log in to LinkedIn.

Why are we visiting LinkedIn? Well, we’re going to use it to do research on this job title.

For this example, let’s go with the title of Senior Software Engineer. Put that title into the search box at the top of the page.

 

LinkedIn search

The results will appear. At the time of writing, there is a list of job opportunities. This is probably on purpose, but LinkedIn may change this in the future.

LinkedIn search results

We only want to see people. Click on the People link on the left, and the page will show people who have that title.

LinkedIn search results for software engineer

 

Now, the thing to note here is that the list of people will be dependent on your connections. So, it will show people who are closely connected to you at the top of the list. It’s also dependent on their profile setup and keywords they have used, as LinkedIn tries to show you the most relevant people based on your search.

So, we have a list of people with that title. Now what?

 

Look At The Job History Of People With That Title

The next step is to have a look at the job history of people who are currently working in that role.

Why do we do this?

Well, the best way of finding out how to become a certain role is to find people who have done it before, or are doing it now, and see how they got there. LinkedIn is a great way to find this, as people usually list their employment history in their profile.

So, find a profile from the list what has the title you want and click on the name.

Now, I’ve blocked out some of the details of this profile to maintain privacy of the person in question, but you should be able to get the general picture.

software engineer sample profile

This summary section will show an overview of the person, which usually includes their qualifications and experience. However, for most profiles, it’s too broad to use for this research.

Scroll down below that and have a look at the section titled Experience.

software engineer experience

You can see, in this example, that the person currently works as a Senior Software Engineer, because the date says “August 2010 – Present”. They have been in this role for almost 5 years at this company. You can also see what kind of work is involved and usually a little bit about the company.

However, to find out what you need, keep scrolling down.

There should be more entries in this Experience section for this person. LinkedIn profiles, unlike resumes, don’t have a limit on experiences, so you should see all of their roles here.

Sure enough, scrolling to the bottom will see this person’s first role.

software engineer role

This will show how they got started in this industry.

What do you need to do with this information?

 

Write Down Their Job History

Make a list of their roles and dates.

This helps with working out how to get where you want to be, and how long it takes.

So, go through this person’s profile and make a list of:

  • Their job role
  • Their tenure (how long they spent in the role)

Both of these are easily visible in the profile.

But, that’s not all you’ll need. You also need the Education part.

 

Include Their Education

Experience is one thing. Another factor to consider is the education.

Keep scrolling down in the profile you’re looking at, until you see the Education section.

This is important, as it shows you how the person got started in their first role.

education on linkedin example

As you can see, this person has a Bachelor in Computer Studies from a university, then went on to get a Masters in Engineering. They also did some independent coursework, and got a PRINCE2 foundation (which is in the Project Management field).

Once again, take note of these points from the Education, Certifications and Courses section:

  • The achievement (e.g. bachelor’s, master’s, certification)
  • The date achieved

This will show what extra things you need to get into this role.

 

Repeat for More People

Alright, so you’ve got the information from one profile. Now what?

One result is not a definitive guide to getting the role you want.

You should go back to the search results, choose someone else from the list, and repeat the same task.

How many times should you do this? Well, as many as you can until you understand what needs to be done to become this role. As an indication, I would probably get information from 10 different profiles if I was doing this myself.

If you have a large list of people, or are looking for a particular kind of role, you can use filters.

There are filters on the left that let you filter by your relationship, location, company, industry, and more.

I would suggest filtering by country, as different countries may have different requirements. You may also want to filter by company or industry, if you’re looking for those in particular.

The research for each person should take about 10 minutes. Before long, you’ll have a pretty good list of different profiles.

 

Combine and Look for Trends

Once you have a list of people in the role that you want, as well as their history, you should now combine the data.

By this, I don’t mean add them all into a long list. I mean, create some kind of summary that shows the most popular route to getting in to that role.

For example, let’s say you have information on 10 people.

Let’s start with Education. 7 of the 10 got a Bachelor’s degree, 1 has a master’s, and the other 2 didn’t have anything. You could then write down that the education requirement is to get a Bachelor’s degree.

The next step is their first role. Let’s say 6 of them started as a junior software developer, 1 in help desk, 1 as a software engineer, and 1 as a web designer. You should pick the majority here, and note that the first role is a junior software developer.

How long did they stay a junior software developer? Find the most common answer here as well. Let’s say it’s 3.5 years – so write that down. Don’t forget to include the next jobs, as some people move to a different company in the same role, which comes up as two entries on their LinkedIn profile.

Keep going until you get a complete picture of the path to the role you want.

For example, it could look like this:

Senior Software Engineer

  • Bachelor’s Degree in Computer Science
  • 3 years Junior Software Developer
  • 5 years Software Developer
  • 2.5 years Software Engineer
  • 5 years Senior Software Engineer

From this information, you can see the education needed, the job roles on the way to that role, and the time spent in each role. In this example, it shows you need a Bachelor’s degree and 10.5 years experience to become a Senior Software Engineer.

 

Well, I hope this guide has been helpful if you’re trying to work out where your career is going and how to find the path to your ideal job. If you have a long term career plan (link), it’s one step you should be doing. If you don’t have a long term career plan, make one!

Readers, what is your ideal role? What would it take for you to get there? How did you go with this process? Reply in the comments section below.

Career Action Tip: Perform this process for the job role that you want in your IT career.

Lastly, if you enjoy the information and career advice I’ve been providing,sign up to my newsletter belowto stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of jscreationzs / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/how-to-find-the-path-to-your-ideal-job/feed/ 0
Oracle RPAD Function with Exampleshttp://www.completeitprofessional.com/oracle-rpad/ http://www.completeitprofessional.com/oracle-rpad/#comments Thu, 23 Apr 2015 11:00:24 +0000 http://www.completeitprofessional.com/?p=3437 ]]> Oracle RPAD Function with ExamplesThe Oracle RPAD function can be useful, especially when using it with the LPAD function. Let’s learn more about the RPAD function and see some examples in this article.

Purpose of the Oracle RPAD Function

The purpose of the Oracle RPAD function is to take a text value, and “pad” it on the right, by adding extra characters to the right of the value to meet a specified length.

It can be useful for ensuring that all values are the same length. Just like the LPAD function, it’s often used in hierarchical queries.

 

Syntax

The syntax of the RPAD function is:

RPAD( expr, length [, pad_expr] )

Let’s have a look at what each of these parameters mean.

 

Parameters

The parameters of the Oracle RAD function are:

  • expr (mandatory): This is the text value or text expression that you want to pad.
  • length (mandatory): This is the total length value that the expr will be padded to.
  • pad_expr (optional): This is the character or set of characters to use for padding the expr value. The default value is a single space.

 

Some things to note about the RPAD function:

  • The length specifies the display length, and not the number of characters in the string. This is mostly the same, but for some multibyte character sets, it can be different. If you’re using VARCHAR2 values then it should match.
  • If the length value is shorter than the length of expr, then the expr is trimmed to be length characters.
  • If pad_expr is not specified, a single space is used.
  • The return data type is TEXT.

 

Can You Use Both Oracle RPAD and LPAD Functions At Once?

Yes, you can use RPAD and LPAD in the same query. This is quite common, as sometimes you want to pad characters to both sides of a string.

See the examples section below for more information on how you can do this and what the results are.

 

Can You Use Oracle RPAD with a NULL String?

No, RPAD will not work with NULL values. If the expression you’re providing contains a NULL value, or if you’re using a column that may contain a NULL value, you’ll need to use the NVL function first (or a function like COALESCE or DECODE to change it to a non-NULL value).

So, instead of this function:

RPAD(columnname, 15, ' ')

You’ll need to use something like:

RPAD(NVL(columnname, ' '), 15, ' ')

See the examples below for more information.

If you don’t use a NVL function or something similar, your return value will be NULL. This may or may not be the desired outcome.

 

Examples of the RPAD Function

Here are some examples of the RPAD function. I find that examples are the best way for me to learn about code, even with the explanation above.

Example 1

This example uses RPAD with the default padding value.

SELECT first_name, RPAD(last_name, 15) AS padded_value
FROM customers;

Result:

FIRST_NAMEPADDED_VALUE
JohnSmith
SallyJones
SteveBrown
MarkAllan
AdamCooper
JoshThompson
PeterManson
(null)(null)

 

The names have all been padded with spaces on the right to be the same length.

 

Example 2

This example uses a * as the padding value.

SELECT first_name, RPAD(last_name, 15, '*') AS padded_value
FROM customers;

Result:

FIRST_NAMEPADDED_VALUE
JohnSmith**********
SallyJones**********
SteveBrown**********
MarkAllan**********
AdamCooper*********
JoshThompson*******
PeterManson*********
(null)(null)

The values have had a * character padded to the right instead of a space.

 

Example 3

This example uses a length that is less than some of the values.

SELECT first_name, RPAD(last_name, 3, ' ') AS padded_value
FROM customers;

Result:

FIRST_NAMEPADDED_VALUE
JohnSmith
SallyJones
SteveBrown
MarkAllan
AdamCoope
JoshThomp
PeterManso
(null)(null)

Some of the values are trimmed to match the length value of 5.

 

Example 4

This example uses RPAD on a number column.

SELECT employees, RPAD(employees, 4, ' ') AS padded_value
FROM customers;

Result:

EMPLOYEESPADDED_VALUE
44
1010
1515
2323
5555
11
(null)(null)
(null)(null)

The values are padded in the same way as a string value.

 

Example 5

This example uses LPAD and RPAD in the one statement, with different characters to show you how they are added.

SELECT last_name, RPAD(LPAD(last_name, 10, '#'), 15, '*') AS padded_value
FROM customers;

Result:

LAST_NAMEPADDED_VALUE
Smith#####Smith*****
Jones#####Jones*****
Brown#####Brown*****
Allan#####Allan*****
Cooper####Cooper*****
Thompson##Thompson*****
Manson####Manson*****
(null)(null)

The value is padded with # on the left, which varies to match the 10 character length, and then a set of * to bring the 10 characters up to 15 characters.

 

Example 6

This example uses the NVL function with a NULL value.

SELECT country, RPAD(NVL(country, ' '), 10, '_') AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USAUSA_______
USAUSA_______
CanadaCanada____
UKUK________
USAUSA_______
(null) _________
FranceFrance____
(null) _________

The values which are not null are padded, and the null value is represented as a space character.

 

Example 7

This example uses a NULL value as the padding expression, just to see what happens.

SELECT country, RPAD(country, 8, NULL) AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USA(null)
USA(null)
Canada(null)
UK(null)
USA(null)
(null)(null)
France(null)
(null)(null)

All of the values are changed to NULL, which is probably not what you wanted.

 

Example 8

This example shows how to use LPAD with multiple characters as your pad_expr.

SELECT country, RPAD(country, 15, '-*') AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USAUSA-*-*-*-*-*-*
USAUSA-*-*-*-*-*-*
CanadaCanada-*-*-*-*-
UKUK-*-*-*-*-*-*-
USAUSA-*-*-*-*-*-*
(null)(null)
FranceFrance-*-*-*-*-
(null)(null)

The country values are padded with a combination of – and *. If there is not an exact match between padding characters and places remaining (such as with Canada or UK), then only part of the padding expression is used.

 

Example 9

This example uses a dynamic length, which is based on the length of each value.

SELECT country, RPAD(country, LENGTH(country)*2, '*') AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USAUSA***
USAUSA***
CanadaCanada******
UKUK**
USAUSA***
(null)(null)
FranceFrance******
(null)(null)

The values are padded to different lengths, as determined by the LENGTH function. Each name has a different number of * characters after it.

 

Similar Functions

Some functions which are similar to the RPAD function are:

  • LPAD – This function is similar to RPAD, but will add characters to the left of the string.
  • CONCAT – This function will combine or concatenate two values together.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of digitalart / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/oracle-rpad/feed/ 0
What Is ITSM and What Does It Mean for Software Developers?http://www.completeitprofessional.com/what-is-itsm/ http://www.completeitprofessional.com/what-is-itsm/#comments Mon, 20 Apr 2015 11:00:31 +0000 http://www.completeitprofessional.com/?p=3430 ]]> What Is ITSM and What Does It Mean for Software DevelopersHave you heard of the term ITSM? Do you have some vague understanding of it being some kind of service desk process? Well, there’s more to it than that. Learn what ITSM is and how it impacts you as a software developer in this article.

In this article, we’ll have a look at what ITSM is, and how it’s used in an organisation. There are plenty of other sites out there that are focused on ITSM so we won’t go into too much detail. However, as you’re a software developer, I’ll explain how it’s relevant to you and what you can do with it to improve your career.

 

What Is ITSM?

ITSM stands for Information Technology Service Management. According to the definition on SysAid, it is:

“The implementation and management of quality IT services that meet the needs of the business. IT service management is performed by IT service providers through an appropriate mix of people, process and information technology. See also service management.”

Let’s break this down.

  • Quality IT services – whatever the IT department provides, it needs to be good quality.
  • Meet the needs of the business – it needs to be helpful and satisfy the requirements and needs of the business.
  • People, process, and information technology – it’s not all about servers and software. People and processes are involved too.

ITSM aims to manage IT services across the company, not just in “silos” or in different business units.

It’s also related to ITIL, as ITIL is one framework of performing ITSM.

That’s all well and good. The IT department would have support and management teams who look at this. How does it impact you as a software developer?

 

What Do Software Developers Need To Know About ITSM?

As a software developer, you’re likely working on projects to develop systems or make changes to existing systems. Or, you’re working in an application support role where you resolve defects on existing systems.

In both cases, it’s good to know about ITSM.

There are a few areas you should know about:

  • Understanding how the incident management process and support process works
  • If you work in support, understand the importance of the issue
  • If you raise the incident, understand how support works
  • Think long term with your development
  • Documentation can help

Let’s look at each of these in more detail.

 

Understand the Incident Management and Service Desk Process

Sometimes, as a developer, the incident management and service desk process is kind of like a “black box”, to use a software term. It can be something that you initiate by raising an issue and wait for a response, without any idea of how it works on the inside.

Fair enough, too. You might think you don’t need to know how the support process works. You just want to know how to raise issues, how to track them, and that they get resolved.

However, it’s important to understand, even just at a high level.

Why do I say this? It can help the organisation as a whole. It can also help you do your job better, and help the support teams with getting things done. You’ll know what kind of requests to raise, where they go, and the timeframes for getting resolutions.

 

If You Receive Support Issues

If you’re a developer that works on the application support side of the issue, then your approach to ITSM would be different. You would be the one receiving the requests, either from other developers or from business users.

This is how I started my career. My first role as a software consultant was application support for an Oracle-based system. Every day, we received requests to look into problems or to run reports or to fix defects.

Over time, I began to learn how this process worked. I understood the difference between each type of request. I understood what was being asked, and how to ask for more information if needed.

Most importantly, though, I learnt to understand the business side of the issue. This helped with understanding the priority, understanding why they were asking for something, and the impact on the business if the issue was not fixed.

For example, an issue might be discovered that causes 5% of transactions to fail to be sent to another system. What’s the impact? As a support developer, you might need to go into a system and retrigger them, which may take 30 minutes per week. To you, it might not be a big priority. However, to the business, these transaction failures might cause delays in getting data to other systems, delays or incorrect information being provided to customers, extra manual work by people to make temporary fixes, lower customer satisfaction, loss of revenue, or any range of factors. From the business side, it could be a big issue.

So, understanding the business side is probably the most important thing you can do when it comes to ITSM as a recipient of these support issues.

 

If You Raise Support Issues

What if you’re a developer who is on the other side – one that raises support issues?

This is quite common. You can also be both – a developer who supports one system, but raises issues with another.

In any case, you’ll be raising issues with a system. To improve the way you do your work, it helps to understand this “black box” of ITSM as it can improve your job and your career. There are many reasons and ways that learning about ITSM can improve your career. SysAid has also written an article on ITSM tips in general, but there are some I’d like to add that are relevant for software developers.

If you can learn about the process for raising support issues, problems, and change requests, then it can help you do your job better.

If you know about the different teams involved and what they do, it can help to understand where requests go and can help your requests get done faster.

If you know what kind of work that the support teams do for each type of request, you will know what kind of information to add into the request.

As you can see, there are a few areas you can learn more about, which can improve your efficiency at work for this role.

 

Think Long Term With Your Software Development

As a software developer, we’re often under pressure to get things done by a certain date and of high quality. This balance between quality and time is something we all face. It can sometimes mean that the quality drops, to get things done on time, or to make things simpler.

However, when you’re developing software, and even designing it, it’s better to think long term. You probably knew this already, but another justification you can make is that it helps the support process.

The support teams who work on resolving defects as part of the ITSM process will be handling your software in the future, once it is implemented. The more issues it creates, the more work they will have to do, and the bigger impact it will have on the business. So, consider that writing good quality code will make things easier for the business in the long term.

Try to avoid applying “band-aid” fixes, which are temporary fixes or those that are low quality, just to get something done.

This is something you probably knew about already, but when presented to the rest of the team in this light, it may convince them that quality is important.

 

Documentation Helps

Another factor to consider is the importance of documentation.

Sure, your design may have been documented at the start and your code is commented, but when your software is implemented, it needs to be supported. Documentation of the software and of your changes can help with that.

The kind of documentation that I’m referring to is:

  • System design: how your system or component works internally
  • Code commenting: comments within your code for others to read
  • Interface specifications: how this system talks to other systems, which can be very useful for the support teams.

All of this documentation can help the support team in diagnosing and fixing any issues that are found in the software. It can also identify which issues are done by design of the system, or are actual defects.

 

So, ITSM can be good to know as a software developer, whether you’re working on projects or in application support. There are a few areas you can learn about, as they help to improve your work and the organisation in a small way.

Career Action Tip: Find out how your incident management or support process works in your current company.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of Stuart Miles / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/what-is-itsm/feed/ 0
Oracle COALESCE Function with Exampleshttp://www.completeitprofessional.com/oracle-coalesce/ http://www.completeitprofessional.com/oracle-coalesce/#comments Thu, 16 Apr 2015 11:00:33 +0000 http://www.completeitprofessional.com/?p=3421 ]]> Oracle FunctionThe Oracle COALESCE function is one of the more difficult functions to understand. Let’s take a look at this function as well as some examples.

Purpose of the Oracle COALESCE Function

The Oracle COALESCE function aims to return a non-NULL value. It is supplied with a series of values, and returns the first value of those which is not NULL.

It’s great for checking if values are NULL and returning one of the values.

Let’s take a look at the syntax.

 

Oracle COALESCE Syntax

The syntax of the Oracle COALESCE function is:

COALESCE( expr1, expr2, [expr...] )

Let’s look at these parameters in more detail.

 

Parameters

The parameters of the X function are:

  • expr1 (mandatory) – This is the first expression to check for a NULL value. If it is not NULL, then this value is returned.
  • expr2 (mandatory) – This is the second expression to check for a NULL value.
  • expr… (optional) – Further expressions can be specified, to be checked in case expr1 and expr2 are NULL.

 

Some things to note for the Oracle COALESCE function:

  • Only two expressions are needed.
  • The first non-NULL expression is returned by the function. This could be expr1, expr2, expr5, or any other expression.
  • If all specified expressions are NULL, the function returns NULL. So, it is not a guarantee that no NULL values will be returned.
  • The data type returned will be calculated by Oracle based on the expressions.

This function also uses what’s called “short circuit evaluation”. According to Oracle, it means that the expressions are evaluated and determined if they are NULL one at a time, rather than all values being evaluated before checking if any are NULL.

So, if you have a long list of expressions with functions and are worried about the run time for calculating each of the functions for each row, you won’t need to be as worried, because the functions will only calculate if the expressions before them are NULL.

 

Can You Use Oracle COALESCE With a Date?

Yes, you can use a DATE value inside COALESCE. It’s treated the same as supplying any other type of expression.

See the examples below for more information on using a date.

 

Can You Use Oracle COALESCE With an Empty String?

When using COALESCE, an empty string is treated the same as a NULL value. So, as you can see in the examples below, the COALESCE statement with an empty string tries to use the next available value.

 

Can You Use Oracle COALESCE in a WHERE Clause?

Yes, you can, though it may not be the best way to do it.

The example below shows how to use a COALESCE function in a WHERE clause. However, there are probably better ways to write the statement, depending on how you use it in your application.

 

What’s the Difference between NVL and COALESCE in Oracle?

There are several differences between NVL and COALESCE in Oracle:

  • COALESCE is part of the ANSI-92 standard, where NVL is Oracle specific
  • When using two values, they show the same results
  • NVL evaluates both arguments and gives a result. COALESCE evaluates arguments as needed, and is usually faster
  • NVL does an implicit conversion to the data type of the first parameter, and COALESCE does not (it will throw an error if they are different)
  • NVL can only have two arguments, but COALESCE can have more than 2.

 

Examples of the COALESCE Function

Here are some examples of the Oracle COALESCE function. I find that examples are the best way for me to learn about code, even with the explanation above.

These examples use the sample customers table that I have used for several other examples.

CREATE TABLE customers (
 first_name varchar2(100),
 last_name varchar2(100),
 country varchar2(20),
 full_address CLOB,
 employees number,
 start_date date
 );

 

The data is then inserted:

INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('John', 'Smith', 'USA', '10 Long Road', 4, '12-APR-2010');
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('Sally', 'Jones', 'USA', '50 Market Street', 10, '04-JUL-2011');
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('Steve', 'Brown', 'Canada', '201 Flinders Lane', 15, '21-MAR-2009');
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('Mark', 'Allan', 'UK', '8 Smith Street', 23, '1-FEB-2001');
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('Adam', 'Cooper', 'USA', '14 Wellington Road', 55, NULL);
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('Josh', 'Thompson', NULL, '80 Victoria Street', 1, '10-FEB-2012');
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES ('Peter', 'Manson', 'France', '5 Johnson St', NULL, '16-OCT-2012');
 INSERT INTO customers (first_name, last_name, country, full_address, employees, start_date) VALUES (NULL, '', NULL, '155 Long Road', NULL, '16-OCT-2012');

 

The data looks like this:

SELECT * FROM customers;
FIRST_NAMELAST_NAMECOUNTRYFULL_ADDRESSEMPLOYEESSTART_DATE
JohnSmithUSA10 Long Road412/APR/10
SallyJonesUSA50 Market Street1004/JUL/11
SteveBrownCanada201 Flinders Lane1521/MAR/09
MarkAllanUK8 Smith Street2301/FEN/01
AdamCooperUSA14 Wellington Road55(NULL)
JoshThompson (NULL)80 Victoria Street110/FEB/12
PeterMansonFrance5 Johnson St (NULL)16/OCT/12
 (NULL) (NULL) (NULL)155 Long Road (NULL)16/OCT/12

 

Now, let’s take a look at some Oracle COALESCE examples.

 

Example 1

This query uses two parameters for the COALESCE function

SELECT first_name, last_name, COALESCE(first_name, last_name) AS coal
FROM customers;

Result:

FIRST_NAMELAST_NAMECOAL
JohnSmithJohn
SallyJonesSally
SteveBrownSteve
MarkAllanMark
AdamCooperAdam
JoshThompsonJosh
PeterMansonPeter
(NULL)(NULL)(NULL)

It shows that all rows display the first_name except for the last one, where NULL is displayed, as there is a NULL value for both parameters.

You might notice that in the INSERT statement above, I inserted an empty string. This is converted to a NULL in the Oracle database.

 

Example 2

This example uses two parameters, where the first one may be NULL.

SELECT country, last_name, 
COALESCE(country,last_name) AS coal
FROM customers;

Result:

COUNTRYLAST_NAMECOAL
USASmithUSA
USAJonesUSA
CanadaBrownCanada
UKAllanUK
USACooperUSA
(NULL)ThompsonThompson
FranceMansonFrance
(NULL)(NULL)(NULL)

The result is that the country is shown in most instances, but if it is NULL, the last_name is shown.

 

Example 3

This query shows COALESCE with three parameters.

SELECT first_name, last_name, country, 
COALESCE(first_name, last_name, country) AS coal
FROM customers
WHERE start_date = '16-OCT-2012';

Result:

FIRST_NAMELAST_NAMECOUNTRYCOAL
PeterMansonFrancePeter
(NULL)(NULL)(NULL)(NULL)

You can see that the COALESCE still returns NULL if all parameters are NULL

 

Example 4

This query shows the COALESCE function with different data types (VARCHAR2, NUMBER, CLOB).

SELECT first_name, full_address, employees, start_date, 
COALESCE(first_name, full_address, employees, start_date) AS coal
FROM customers;

Result:

ORA-00932: inconsistent datatypes: expected CHAR got CLOB
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause: 
*Action:
Error at Line: 41 Column: 78

As you can see, the COALESCE function needs to have the same data types for all parameters, otherwise an error is displayed. It can’t convert the full_address CLOB into a VARCHAR2.

 

Example 5

This example uses a lot of parameters for the function.

SELECT first_name, last_name, 
COALESCE(NULL, NULL, first_name, NULL, NULL, NULL, last_name) AS coal
FROM customers;

Result:

FIRST_NAMELAST_NAMECOAL
JohnSmithJohn
SallyJonesSally
SteveBrownSteve
MarkAllanMark
AdamCooperAdam
JoshThompsonJosh
PeterMansonPeter
(NULL)(NULL)(NULL)

It shows the first_name in almost every instance.

 

Example 6

This query uses an empty string as the first parameter.

SELECT first_name, COALESCE('', first_name) AS coal
FROM customers;

Result:

FIRST_NAMECOAL
JohnJohn
SallySally
SteveSteve
MarkMark
AdamAdam
JoshJosh
PeterPeter
(NULL)(NULL)

As you can see, the empty string is treated as a NULL value.

 

Example 7

This query uses COALESCE with a date parameter.

SELECT start_date, COALESCE(start_date, SYSDATE) AS coal
FROM customers;

Result:

START_DATECOAL
12-APR-1012-APR-10
4-JUL-114-JUL-11
21-MAR-0921-MAR-09
1-FEB-011-APR-01
(NULL)16-APR-15
10-FEB-1210-FEB-12
16-OCT-1216-OCT-12
16-OCT-1216-OCT-12

The result shows the start_date, and when it is NULL, it shows today’s date (which is 16 Apr 2015).

 

Example 8

This query uses a COALESCE in the WHERE clause.

SELECT country, LENGTH(country), employees
FROM customers
WHERE COALESCE(employees, LENGTH(country)) > 4

Result:

COUNTRYLENGTH(COUNTRY)EMPLOYEES
USA310
Canada615
UK223
USA355
France6(NULL)

The query only shows records where the COALESCE is greater than 4. The COALESCE returns the number of employees, and if that is NULL, it returns the length of the country name.

 

Similar Functions

Some functions which are similar to the COALESCE function are:

  • NVL – substitutes a value if a NULL value is found

 

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of digitalart / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/oracle-coalesce/feed/ 0
How To Be Taken More Seriously as a Programmerhttp://www.completeitprofessional.com/how-to-be-taken-more-seriously-as-a-programmer/ http://www.completeitprofessional.com/how-to-be-taken-more-seriously-as-a-programmer/#comments Mon, 13 Apr 2015 11:00:12 +0000 http://www.completeitprofessional.com/?p=3416 ]]> How To Be Taken More Seriously as a ProgrammerDo you find that, as a programmer, you’re not taken very seriously? Do you find that people think you just write code and nothing else? Well, you can change that. I’ll show you how you can be taken more seriously as a programmer.

Programmers Are Often Not Taken Seriously

In many workplaces, programmers are not taken very seriously. We’re not seen as people who have great ideas, who understand strategy and customer needs.

People in the workplace think that our job is just to write code and make websites and systems work.

It could be that it’s a pretty new industry. Sure, programming has been around for a while, but only really since the 1990s has it made it into the mainstream as a career choice. Courses are being offered at university and almost every company has some kind of IT department or software development work being done.

It could also be because many programmers are young. The 2015 Stack Overflow Developer Survey showed that the average developer is 28.9 years old (which is very close to my age!), and that 53% of respondents are between 20 and 30. Young people in the workplace generally have a harder time being taken seriously.

I know I have in the past. People think that just because you’re young, you don’t know what you’re doing. And as a programmer, it can be worse:

  • People think all you know how to do is code
  • People think that you’re not serious about your job and just want to have fun
  • People think you don’t understand how business works and what the company strategy is
  • People think all you do is complain

Whether this is true or not, you should try to be taken more seriously at work. It’s good for your career to be understood and respected.

You can do this and still be a programmer though. It just takes a few adjustments.

 

Appearance Is The Most Important

Your appearance, in my opinion, is the single biggest factor in determining what people think of you. It seems superficial and judgemental, but the fact remains that people form an opinion of you based on how you look.

This includes:

  • Your choice of clothes and how they fit
  • Your personal grooming (hair, make-up (if any), facial hair (if any))
  • Your deodorant/cologne, or lack of it

Many workplaces allow and even encourage staff to be more casual at work. You might have seen pictures or read stories about Facebook, Google, or other companies that have casual offices where people wear t-shirts and jeans to work. One of my favourite new shows, Silicon Valley, also depicts this in many of the companies.

This has spread to regular companies where developers can be more relaxed with how they dress and how they appear.

I think you should change this.

My suggestion is that you should consider how your appearance makes you perceived by others, and whether that is what you want.

What do you wear to work on a normal day? What do you wear on “casual fridays”, if your company has one? What does your hair look like? Do you have facial hair? Do you wear make-up?

The style of clothing says a lot about your professionalism. If you normally wear t-shirts and baggy jeans, this says to other people, “Hey, I’m just a casual guy, not looking to go above and beyond for my job or put in extra effort.”

I’ve seen a few people in my time who wear baggy jeans and hoodies, and the impression they give is not a good one.

I would suggest stepping it up a level. Consider a polo shirt or a collared shirt. Get some jeans that fit well and don’t have rips in them. Fix your hair if it’s messy, and trim or shave your facial hair.

It’s not everything, but it’s a good start to being taken more seriously as a software developer.

 

Watch What You Say At Work

You spend a lot of time at work, and as a result, you probably get a long well with your colleageus. Or, at the very least, get to know them a little better.

Because of the amount of time spent there, you’ll probably find yourself talking about all kinds of topics.

To be taken more seriously, you need to consider what you talk about at work and how it might be impacting your reputation or image.

Have you ever met someone at work who talks about how drunk they got on the weekend? Sure, it may have sounded like fun, but did it seem like they were serious about their work? Would you take them more or less seriously if they told you their drunken stories?

The point I’d like to make here is that in order to be taken more seriously at work, you should watch what you say. Remember that you’re in a workplace and that your stories and the things you say reflect your character and attitude towards work and life in general.

 

Less Complaining, More Ideas

This is related to the point above about watching what you say, but it’s more specific.

Over time, you’ll find there are a lot of people who like to complain at work. This is especially true as a software developer, as we all know the kinds of challenges faced by developers. Some common complaints I hear are:

  • Badly designed programs
  • Unrealistic short deadlines
  • Moving business requirements
  • Hard to deal with coworkers or boss

One way to improve how your seen at work is to complain less. Complaints are focused on what is wrong with the world and what is wrong with a situation. They highlight problems – but without any solutions.

A better way to discuss these is to have ideas. Solutions. Ways of fixing these problems.

If you notice something that is not ideal, think of a way that it could be done better. Think of an idea that might improve it. Ask yourself, “what if?”

Coming up with solutions or ideas, instead of problems and complaints, is a big way to be taken more seriously as a developer.

You can discuss these with your coworkers, and even better, take them to your manager. If you have a problem, as well as a way to improve it or reduce the problem, your manager would be glad to hear it.

It shows you’re taking your job seriously and have thought of ways to improve it.

 

You Can Do It Without Being Boring

So, you might think that this advice sounds good, but it’s a bit boring. You might not want to go to work every day in a suit and not have any fun.

Of course, that’s not what I’m saying.

You can still do all of these things and not be boring.

You can make more of an effort with your appearance, cut down on the unprofessional things you say, start thinking of ways to solve problems, and still have time for your lunchtime foosball session or afternoon video game break.

You can balance them both. This article is just trying to suggest some ways you can be taken more seriously, and stop people thinking that you’re just a programmer and that all you’re good for is writing code.

 

Career Action Tip: Think about your appearance at work and choose one thing you can make more professional or less casual. Think of a problem at work and decide on a way it can be solved or improved.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of imagerymajestic / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/how-to-be-taken-more-seriously-as-a-programmer/feed/ 2
Oracle LPAD Function with Exampleshttp://www.completeitprofessional.com/oracle-lpad/ http://www.completeitprofessional.com/oracle-lpad/#comments Thu, 09 Apr 2015 11:00:05 +0000 http://www.completeitprofessional.com/?p=3406 ]]> Oracle LPAD FunctionThe Oracle LPAD function can be quite useful in your queries. Learn more about the LPAD function and see some examples in this article.

Purpose of the Oracle LPAD Function

The Oracle LPAD function takes a text value, and “pads” it on the left, by adding extra characters to the left of the value to meet a specified length.

It’s useful for ensuring that all values are the same length. It’s also used in hierarchical queries.

 

Oracle LPAD Syntax

The syntax of the LPAD function is:

LPAD( expr, length [, pad_expr] )

Let’s take a look at what these parameters mean.

 

Parameters

The parameters of the Oracle LPAD function are:

  • expr (mandatory): This is the text value or text expression that you want to pad.
  • length (mandatory): This is the total length value that the expr will be padded to.
  • pad_expr (optional): This is the character or set of characters to use for padding the expr value. The default value is a single space.

Some things to note about the LPAD function:

  • The length specifies the display length, and not the number of characters in the string. This is mostly the same, but for some multibyte character sets, it can be different. If you’re using VARCHAR2 values then it should match.
  • If the length value is shorter than the length of expr, then the expr is trimmed to be length characters.
  • If pad_expr is not specified, a single space is used.

 

Can You Use LPAD On a Number Column?

Yes, you can use LPAD with a number column. It works in the same way as using a text value.

See the examples section below for more information on how to do this.

 

Can You Use Oracle LPAD Without Truncating?

Yes you can, but you need to use it along with other functions.

As mentioned above, if the length value is less than the length of the provided expression, then the expression is trimmed to be that length, rather than padded.

To avoid this will depend on your code and what you’re using the LPAD function for. You could use a LENGTH function to get the length of the string. You could use a large length value and then a SUBSTR to get the desired length.

The examples below show one way of doing it.

 

Why Is My LPAD Not Working?

There are a few reasons why your LPAD might not be working:

  • The length might be less than the expression
  • You might need to use RPAD instead of LPAD
  • You might be trying to insert the wrong data type or size of data into a column

Once again, it depends on what you’re using the function for, so try to search for your exact problem and see if that helps.

 

Can You Use LPAD with NULL?

No, LPAD will not work with NULL values. If your expression contains a NULL value, or if you’re using a column that may contain a NULL value, you’ll need to use the NVL function first (or a function like COALESCE or DECODE to change it to a non-NULL value).

If you don’t use a NVL function or something similar, your return value will be NULL. This may or may not be the desired outcome.

So, instead of:

LPAD(columnname, 20, ' ')

You’ll need to use something like:

LPAD(NVL(columnname, ' '), 20, ' ')

See the examples below for more information

 

Can You Use LPAD with RPAD?

Yes, you can. In fact, this is a very common way to use the LPAD function.

By using it with LPAD and RPAD, you can append characters to both ends of a string, which can be different characters.

See the examples section below for more information.

 

Examples of the Oracle LPAD Function

Here are some examples of the Oracle LPAD function. I find that examples are the best way for me to learn about code, even with the explanation above.

Example 1

This example uses LPAD with the default padding value.

SELECT first_name, LPAD(first_name, 10) AS padded_value
FROM customers;

Result:

FIRST_NAMEPADDED_VALUE
John      John
Sally     Sally
Steve     Steve
Adam      Adam
Josh      Josh
Peter     Peter
Mark      Mark

The names have all been padded with spaces on the left to be the same length.

 

Example 2

This example uses a * as the padding value.

SELECT first_name, LPAD(first_name, 10, '*') AS padded_value
FROM customers;

Result:

FIRST_NAMEPADDED_VALUE
John******John
Sally*****Sally
Steve*****Steve
Adam******Adam
Josh******Josh
Peter*****Peter
Mark******Mark

The values have had a * character padded to the left instead of a space.

 

Example 3

This example uses a length that is less than some of the values.

SELECT first_name, LPAD(first_name, 4, ' ') AS padded_value
FROM customers;

Result:

FIRST_NAMEPADDED_VALUE
JohnJohn
SallySall
SteveStev
AdamAdam
JoshJosh
PeterPete
MarkMark

Some of the values are trimmed to match the length value of 4.

 

Example 4

This example uses LPAD on a number column.

SELECT employees, LPAD(employees, 5, ' ') AS padded_value
FROM customers;

Result:

EMPLOYEESPADDED_VALUE
4    4
10   10
15   15
55   55
1    1
 (null)(null)
23   23

The values are padded in the same way as a string value.

 

Example 5

This example uses LPAD and RPAD in the one statement, with different characters to show you how they are added.

SELECT last_name, RPAD(LPAD(last_name, 10, '#'), 15, '*') AS padded_value
FROM customers;

Result:

LAST_NAMEPADDED_VALUE
Smith#####Smith*****
Jones#####Jones*****
Brown#####Brown*****
Cooper####Cooper*****
Thompson##Thompson*****
Manson####Manson*****
Allan#####Allan*****

The value is padded with # on the left, which varies to match the 10 character length, and then a set of * to bring the 10 characters up to 15 characters.

 

Example 6

This example uses the NVL function with a NULL value.

SELECT country, LPAD(NVL(country, ' '), 10, '_') AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USA_______USA
USA_______USA
Canada____Canada
USA_______USA
_________
France____France
UK________UK

The values which are not null are padded, and the null value is represented as a space character.

 

Example 7

This example uses a NULL value as the padding expression, just to see what happens.

SELECT country, LPAD(country, 10, NULL) AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USA (null)
USA (null)
Canada (null)
USA (null)
 (null)(null)
France (null)
UK (null)

All of the values are changed to NULL, which is probably not what you wanted.

 

Example 8

This example shows how to use LPAD with multiple characters as your pad_expr.

SELECT country, LPAD(country, 10, '-*') AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USA-*-*-*-USA
USA-*-*-*-USA
Canada-*-*Canada
USA-*-*-*-USA
(null)(null)
France-*-*France
UK-*-*-*-*UK

The country values are padded with a combination of – and *. If there is not an exact match between padding characters and places remaining, then only part of the padding expression is used.

 

Example 9

This example uses a dynamic length, which is based on the length of each value.

SELECT country, LPAD(country, LENGTH(country)*2, '*') AS padded_value
FROM customers;

Result:

COUNTRYPADDED_VALUE
USA***USA
USA***USA
Canada******Canada
USA***USA
(null)(null)
France******France
UK**UK

The values are padded to different lengths, as determined by the LENGTH function.

 

Similar Functions

Some functions which are similar to the LPAD function are:

  • RPAD – This function is similar to LPAD, but will add characters to the right of the string.
  • CONCAT – This function will combine or concatenate two values together.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of digitalart / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/oracle-lpad/feed/ 0
How To Work Overtime Without Being Taken Advantage Ofhttp://www.completeitprofessional.com/how-to-work-overtime/ http://www.completeitprofessional.com/how-to-work-overtime/#comments Mon, 06 Apr 2015 11:00:10 +0000 http://www.completeitprofessional.com/?p=3399 ]]> How To Work Overtime Without Being Taken Advantage OfWorking overtime is quite common as a software developer. Doing overtime without it being taken for granted by your employer is tricky, though.

Why do you want to avoid it being taken for granted?

Well, first of all, your manager shouldn’t expect you to work overtime all of the time. I’ll explain this further soon, as it’s a tricky area. Also, you shouldn’t have to work overtime just to get your work done, as it may be a result of bad planning and expectations set by the employer.

In this article, I’ll share a few reasons why working excessive amounts of overtime is bad, and what you can do about it.

 

How To Work Overtime: A Little Bit Is OK, And It’s Often Good For You

When I’m talking about working overtime, I’m not talking about the little bit of extra work that you put in outside of the 9AM to 5PM timeslot. I’m not talking about getting to the office at 8:30 and leaving at 5:30 every day, before most people get there and after many people leave. That isn’t what I’d consider overtime. That’s what I would consider putting in the effort and making a good appearance, as I’ve mentioned in my other posts on professionalism.

Overtime, in this instance, is where you’re working multiple hours past your normal time, for at least a few days, or even on the weekends. Hours that are outside the normal working hours.

And, a little bit of overtime is OK.

However, it should only be done when it’s needed. It shouldn’t be normal practice – which I’ll explain in the next section.

Before I started working in IT, I worked in a restaurant as a waiter. It was a casual job where we were paid by the hour. We had certain shifts – where we would come in at a certain time, leave when the shift ended, and log our start and end times for the day on a piece of paper. The point of this was so that the boss knew how many hours we had worked and how much to pay us.

In that job, and in many other casual jobs, overtime is often compensated. You usually get paid extra for the hours you put in, so the overtime is treated differently. If you work an extra hour, you get paid an extra hour. This may be because it’s an hourly paid job, or because of the irregular hours, but the point is that you get paid for overtime.

In the IT world, though, it’s not usually the case. Unless you get special approval to get paid more, it’s often just part of the role.

 

Only Do It When It’s Needed, Not All Of The Time

Sometimes you’ll need to put in the extra hours to get something done. This is normal in the IT industry. There’s a deadline that needs to be met, a bug that needs to be fixed, or a document that needs to be completed by a certain date. So, you might need to work back a few extra hours to get it done.

This is something that happens quite a lot in the IT industry, and you may have already had to work overtime in your role. I’ve done it many times – project implementations, fixing bugs, getting a document completed so it can be sent to the developers.

But, like I’ve mentioned in the heading, it should only be done when it’s needed, and should not be the normal mode of operation or the normal way of doing things.

This is for a few reasons:

  • It’s not healthy
  • It shows a lack of planning in the team
  • Your time is valuable
  • It may also show a lack of personal management

Firstly, it’s not healthy to be working overtime all of the time. If you have to come in at work at 7 every day and stay until 7 every night, that can’t really be good for you. That’s a 12 hour day, for this example. You need to commute to and from work, eat, sleep, and maybe see family (if you have a family). This is hard to squeeze into a 24 hour day if you’re spending half of the day working. You could end up feeling burnt out.

Also, it shows a lack of planning in the team. One of your manager’s roles is workload management. If you need to work crazy hours constantly just to get the work done, it shows that there is more work that needs to be done than there are people available to do it.

You could be writing code for a new project, running tests to get them completed, or preparing design documents. If you’re spending all this extra time just doing your day job (excluding any abnormal circumstances like project implementation), then your team’s workload probably needs to be assessed.

Your time is also valuable. This took me some time to realise, but there are a lot of other things you could be doing with your time other than working. Sure, we all need to work, and it’s good for your career to put in the extra hours, but doing it constantly isn’t good for your work life balance and can cause you to neglect other areas of your life.

That being said, I am writing this post at 6AM from a hotel in Sydney, Australia, before my workday starts. But this is not the normal behaviour.

The final point is on personal management. This is probably the main reason I see so many people putting in constant overtime. It’s because they don’t know how to manage themselves or their time properly.

Sure, it can be a workload issue, but there are often ways you can improve the way you work to cut down on the time you spend doing things. I’ve written an article on time management for IT professionals which highlights a few things you can do.

So, all of this talk about overtime is great, but how can we do it without being taken advantage of?

 

Ask For Something In Return

The way that I’ve found to avoid being taken advantage of is to ask for something in return.

If people are asking you to work overtime, or if you need to put in the extra hours for a project, then your boss and the team will appreciate it. If you’re worried about being taken advantage of, then you can ask your manager for something in return.

The best thing that I’ve found is asking for “time in lieu”. Time in lieu is basically getting time off for the extra hours that you put in for your project or deadline. It’s like saying “I can work an extra 10 hours this week, so can I take next Friday off.”

This can work well for both parties. The team get your extra time to get done what they need to get done, and you get to have your time back at a later date.

You can do whatever you want on your day off (as long as it’s not work!). The point of this is that you’re getting your time back.

You can ask for overtime compensation, but in my experience, this is harder to get, as it needs approval from different people and work to happen in the payroll area.

I find that as I get older, time becomes more important than money. But it’s up to you.

 

Avoid Suggesting It In Your Estimates

Another way to avoid being taken advantage of by working overtime is to not suggest working overtime in your estimates of how long things can take to get completed.

If someone asks you to do something, or asks how long something will take to get done, don’t include any overtime in your estimate. Don’t suggest that you can work late tonight to get the code completed or the interface changes documented.

Try to include regular working hours and regular time into your work estimates. Sometimes your manager or the person asking will kind of “hint” that something should get extra time, but try not to fall for this hint.

An example of this is the trip that I’m on now. Right now, I’m in Sydney for a two-day workshop for the project I’m on. I currently live in Melbourne. For those of you not familiar with Australia, it’s about an hour and a half flight between these two cities. I was in meetings the day before I left and someone asked me to get something done, which seemed important. I told them I was in workshops all day for the next two days and won’t be able to look at it until I return.

This was my way of setting expectations that there was other work going on that was taking up my whole day, and that I couldn’t put in the extra time.

I mean, I could have put in the extra time to get something done, but it would not have been good quality after spending all day in a workshop.

You might notice that I’m writing this in the morning yet saying I didn’t want to do overtime for work. This is about setting expectations for my job. Also, the work I do on Complete IT Professional is out of passion, so it doesn’t count as work!

Readers, have you ever been asked to, or had to, work overtime? Did you ever feel like you were being taken advantage of? Have other people been working overtime and it looks like they have been taken advantage of?

Career Action Tip: Assess your current workload and hours that you’re working to see if you’re doing a lot more hours than you should be.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

]]>
http://www.completeitprofessional.com/how-to-work-overtime/feed/ 2
Oracle ROUND Function with Exampleshttp://www.completeitprofessional.com/oracle-round/ http://www.completeitprofessional.com/oracle-round/#comments Thu, 02 Apr 2015 11:00:13 +0000 http://www.completeitprofessional.com/?p=3378 ]]> Oracle ROUND FunctionThe Oracle ROUND function is one of those functions that is used a lot and performs similar in many languages. Let’s take a look at the ROUND function and some examples.

Purpose of the Oracle ROUND Function

The purpose of the Oracle ROUND function is to take a number and round it to the specified number of decimal places. There are a lot of similar functions, but the ROUND function is probably the most common and it’s pretty easy to use.

ROUND can also be used with date input values. You can supply a date value to it, as well as the format, and it will round the date to that format.

 

Oracle ROUND Syntax

The syntax for the ROUND function is:

ROUND( input, roundto)

Let’s take a look at what these values are used for.

 

Parameters

The parameters of the Oracle ROUND function are:

  • input (mandatory): This is the value that is rounded. It can be any numeric data type, or any date data type.
  • roundto (optional): This determines what the input value is rounded to. If it is a number, then you specify the decimal places here. If it is a date, you specify the part of the date.

This function can be used with both dates and numbers. What kind of input does it need?

 

ROUND with Numbers

If you are using the Oracle ROUND function with numbers, then:

  • input needs to be a numeric data type, or a value that can be converted to a numeric data type (such as a number inside a VARCHAR value)
  • roundto needs to be an integer.
  • If roundto is positive, the result is rounded to the right of the decimal point
  • If roundto is negative, the result is rounded to the left of the decimal point
  • If roundto is 0 or omitted, the result is rounded to 0 decimal places
  • If roundto is omitted, the result is in the same data type as the input value
  • If roundto is specified, the result is in a NUMBER data type
  • For NUMBER input values, the value is rounded away from 0 (e.g. 2.5 rounds to 3, -1.5 rounds to 2).
  • For BINARY_FLOAT and BINARY_DOUBLE input values, the value is rounded to the nearest even number.

 

ROUND with Dates

If you are using the Oracle ROUND function with dates, then:

  • input needs to be a date or datetime with timestamp
  • roundto can be any valid format mask (e.g. year, month, day, week, minute)
  • If roundto is omitted, the input is rounded to the nearest day
  • The value returned is always of data type DATE, even if you specify a different datetime data type.

 

How Do You Always Round Up In Oracle?

The Oracle ROUND function will round the number up or down, depending on the decimal places specified. It doesn’t always round up, as you can see in the examples below.

If you want to always round up in Oracle, you would use the CEILING function. This function rounds a number up to the specified value, so you can use the CEILING function to round all of your values up.

A detailed description and examples of this function is coming soon.

 

How Can Oracle Round Down 2 Decimal Places?

You can use the ROUND function to round to 2 decimal places, by specifying the number 2 as the second parameter. However, this will not always round down. It could round up, depending on your input value.

To always round down, you would use the FLOOR function, which is the opposite of the CEILING function mentioned above.

A detailed description and examples of this function is coming soon.

 

How Can Oracle Round To The Nearest 5?

Yes, you can do this with ROUND.

To round to the nearest 5, you use the ROUND function and divide your number by 5, then multiply it by 5.

For example:

SELECT ROUND(3162.845/5)*5 FROM dual;

Result: 3165

This function first doubles the number you wish to round, and then rounds it. Then, it halves the result. So, this example would perform these steps:

  • 3162.845 / 5 =632.569
  • ROUND(632.569) = 633
  • 633 * 5 = 3165

The action of dividing, rounding, then multiplying causes the result to be rounded to the nearest 5.

 

How Can Oracle Round To The Nearest 100?

To round to the nearest 100, you can use a negative value for the roundto parameter in the Oracle ROUND function. The negative value will round to the left of the decimal place, so you can get a value that is rounded to the nearest 100.

SELECT ROUND(12345.67, -2) FROM dual;

Result: 12300

See the examples below for more information.

 

Examples of the Oracle ROUND Function

Here are some examples of the Oracle ROUND function. I find that examples are the best way for me to learn about code, even with the explanation above.

Example 1

This example rounds a decimal number to 1 place.

SELECT ROUND(3162.845, 1) AS ROUNDED
FROM dual;

Result:

ROUNDED
3162.8

 

Example 2

This example rounds a decimal to 5 places.

SELECT ROUND(3162.8451297, 5) AS ROUNDED
FROM dual;

Result:

ROUNDED
3162.84513

 

Example 3

This example rounds a decimal to -2 places.

SELECT ROUND(3162.845, -2) AS ROUNDED
FROM dual;

Result:

ROUNDED
3200

 

Example 4

This example rounds a whole number to -3 places.

SELECT ROUND(142786, -3) AS ROUNDED
FROM dual;

Result:

ROUNDED
143000

 

Example 5

This example rounds a decimal to 0 places.

SELECT ROUND(3162.845, 0) AS ROUNDED
FROM dual;

Result:

ROUNDED
3163

 

Example 6

This example rounds a decimal with no roundto parameter specified.

SELECT ROUND(3162.845) AS ROUNDED
FROM dual;

Result:

ROUNDED
3163

 

Example 7

This example rounds a number to the nearest 5.

SELECT ROUND(3162.845/5)*5 as ROUNDED
FROM dual;

Result:

ROUNDED
3165

 

Example 8

This example rounds a number to the nearest hundred.

SELECT ROUND(142786, -2) AS ROUNDED
FROM dual;

Result:

ROUNDED
142800

 

Example 9

This example rounds a date to the nearest year.

SELECT SYSDATE, ROUND(SYSDATE, 'YEAR') AS ROUNDED
FROM dual;

Result:

SYSDATEROUNDED
02/APR/1501/JAN/15

 

Example 10

This example rounds a date to the nearest month.

SELECT SYSDATE, ROUND(SYSDATE, 'MONTH') AS ROUNDED
FROM dual;

Result:

SYSDATEROUNDED
02/APR/1501/APR/15

 

Similar Functions

Some functions which are similar to the ROUND function are:

  • CEILING – This function rounds a number up to the specified precision
  • FLOOR – This function rounds a number down to the specified precision
  • TRUNC – This function truncates either a number or a date value to the specified precision

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of digitalart / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/oracle-round/feed/ 0
Oracle TRUNC Function Explained with Exampleshttp://www.completeitprofessional.com/oracle-trunc/ http://www.completeitprofessional.com/oracle-trunc/#comments Thu, 26 Mar 2015 11:00:19 +0000 http://www.completeitprofessional.com/?p=3371 ]]> Oracle TRUNC FunctionThe TRUNC function is one of the most common and versatile functions in Oracle. Let’s take a look at how it’s used and some examples.

Purpose of the Oracle TRUNC Function

The purpose of the Oracle TRUNC function is to truncate either a number or a date value.

The TRUNC function works on two different data types – number or date. This means you can provide it with either of these two data types, and the TRUNC function will perform slightly differently and give you a result for that data type.

If you supply it a date data type, then it will return the portion of that value as specified by your format model. If you supply it a numeric data type, it will round the number to the specified number of decimal places.

Let’s take a look at how this is used.

 

Syntax

The syntax of the TRUNC function is slightly different, depending on which data format you’re supplying. In both cases, there are two parameters.

Using a date value, the syntax is:

TRUNC( date, fmt )

Using a number, the syntax is:

TRUNC( number, decimals )

Let’s take a look at the parameters for this function.

 

Parameters

The parameters of the Oracle TRUNC function for dates are:

  • date (mandatory): This is the date or datetime value that is to be truncated or reduced to.
  • fmt (optional): This is the format that the date value is to be truncated to. If it is not specified, then the function will truncate the date value to the nearest day. See below for the valid format parameters that can be used.

The parameters of the Oracle TRUNC function for numbers are:

  • number (mandatory): This is the numeric value that is to be truncated.
  • decimals (optional): This is the number of places to the left or right of the decimal point to truncate the number value. If it is positive, digits to the right are truncated, and if it is negative, digits to the left are truncated. If it is omitted, number is then truncated to a whole number (0 decimal places).

If you use the date version of the TRUNC function, then the value returned is always of datatype date, even if you use a different datetime datatype as the parameter.

If you use the number version of the TRUNC function, then the returned value is the same as the number parameter if you don’t specify the decimals. If you do specify the decimals, then it returns a data type of NUMBER.

 

Available Formats for Date TRUNC

These are the available format values for using the TRUNC function on dates. You can specify these as part of the second parameter when using the TRUNC function on dates.

UnitValid Format Parameters
YearSYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y
ISO YearIYYY, IY, I
QuarterQ
MonthMONTH, MON, MM, RM
WeekWW
Week NumberIW
WeekW
DayDDD, DD, J
Start day of the weekDAY, DY, D
HourHH, HH12, HH24
MinuteMI

 

Using Oracle TRUNC on SYSDATE

The Oracle TRUNC function is often used on the SYSDATE keyword. It’s something I do quite often. It’s useful to get the current date, without the time, by using the SYSDATE keyword.

You can use it by simply running:

TRUNC(SYSDATE)

See below for more examples about using TRUNC with SYSDATE.

 

Can You Use Oracle TRUNC on a TIMESTAMP?

Yes, you can. The DATE version of the TRUNC function accepts any date data type, including timestamp. You can then truncate it to the format you need.

As of Oracle version 9 (version 9.2.0.3 I believe), you can perform TRUNC on timestamp. Before this version, you got an error (ORA-00932: inconsistent datatypes: expected NUMBER got TIMESTAMP).

If you are unable to use TRUNC on timestamps in your version, you can CAST it to a DATE first:

TRUNC(CAST(TIMESTAMP as DATE))

See below for some examples on using TRUNC with TIMESTAMP.

 

Can You Use Oracle TRUNC on a STRING?

No, you can’t use the Oracle TRUNC function on a string data type. If you want to remove characters from a string data type, you can use the SUBSTR function

 

Examples of the Oracle TRUNC Function

Here are some examples of the TRUNC function. I find that examples are the best way for me to learn about code, even with the explanation above.

These examples use a table called “datelist” that I created using the following code:

CREATE TABLE datelist (
 datevalue DATE,
 timestampvalue TIMESTAMP
 );

 

INSERT INTO datelist (datevalue, timestampvalue) VALUES (SYSDATE, SYSTIMESTAMP);

 

SELECT datevalue, timestampvalue FROM datelist;
DATEVALUETIMESTAMPVALUE
26/MAR/1526/MAR/15 05:58:01.378000000 AM

And yes, it is about 6AM when I’m writing this post!

Example 1

This example shows how to use TRUNC on a date to truncate it to a year.

SELECT TRUNC(datevalue, 'YEAR') AS TRUNCVALUE
FROM datelist;

Result:

TRUNCVALUE
01/JAN/15

It shows the date value converted to a year, which is the first day of the first month of the year.

 

Example 2

This example uses TRUNC on a date to truncate it into a month.

SELECT TRUNC(datevalue, 'MONTH') AS TRUNCVALUE
FROM datelist;

Result:

TRUNCVALUE
01/MAR/15

It shows a similar result, converting the date to a month and year value, which changes the day to the first of that month.

 

Example 3

This example uses TRUNC on a date to truncate it to a day.

SELECT TRUNC(datevalue, 'DD') AS TRUNCVALUE
FROM datelist;

Result:

TRUNCVALUE
26/MAR/15

It looks to be the same value that is returned, because the provided value is already a day/month/year type.

 

Example 4

This example uses TRUNC to show the date value as an IW format (which is the week number in a year).

SELECT TRUNC(datevalue, 'IW') AS TRUNCVALUE
FROM datelist;

Result:

TRUNCVALUE
23/MAR/15

It has truncated the value back to March 23, which is the Monday of the same week.

 

Example 5

This example shows how to use TRUNC on SYSDATE.

SELECT TRUNC(SYSDATE) AS TRUNCVALUE
FROM dual;

Result:

TRUNCVALUE
26/MAR/15

It looks to be the same value that is returned, because SYSDATE is already in that format.

 

Example 6

This example uses TRUNC on a TIMESTAMP value.

SELECT TRUNC(timestampvalue) AS TRUNCVALUE
FROM datelist;

Result:

TRUNCVALUE
26/MAR/15

As you can see, it has removed the time value from the timestamp and just returned a date.

 

Example 7

This example uses a TIMESTAMP and shows it as months.

SELECT TRUNC(timestampvalue, 'MM') AS TRUNCVALUE
FROM datelist;

Result:

TRUNCVALUE
01/MAR/15

This shows the timestamp value truncated to the month, which is March.

 

Example 8

This example shows TRUNC using a number.

SELECT TRUNC(5718.46987) AS TRUNCVALUE
FROM dual;

Result:

TRUNCVALUE
5718

The number is truncated to a whole number. The decimals are removed, which is done without rounding.

 

Example 9

This example truncates the number to 2 places.

SELECT TRUNC(5718.46987, 2) AS TRUNCVALUE
FROM dual;

Result:

TRUNCVALUE
5718.46

The result shows the original number with two decimal places, without any rounding.

 

Example 10

This example truncates the number to 3 places to the left of the decimal.

SELECT TRUNC(5718.46987, -3) AS TRUNCVALUE
FROM dual;

Result:

TRUNCVALUE
5000

This value is the result of truncating the 3 decimal places, so it only shows the thousands value.

 

Example 11

This example truncates the number using a decimal value of 0.

SELECT TRUNC(5718.46987, 0) AS TRUNCVALUE
FROM dual;

Result:

TRUNCVALUE
5718

This is the same as providing no decimal places, as it rounds to a whole number.

 

Similar Functions

Some functions which are similar to the Oracle TRUNC function are:

  • TRIM – removes the leading and trailing characters from a string
  • SUBSTR – returns a part of the provided value, based on the specified position and length
  • ROUND – rounds a value to the specified number of places.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of digitalart / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/oracle-trunc/feed/ 0
What Is The System Analyst Job Description?http://www.completeitprofessional.com/system-analyst-job-description/ http://www.completeitprofessional.com/system-analyst-job-description/#comments Mon, 23 Mar 2015 11:00:07 +0000 http://www.completeitprofessional.com/?p=3366 ]]> What Is The System Analyst Job DescriptionHave you heard of the “System Analyst” job title? Perhaps you are a System Analyst and want to find out what the actual description is. Learn what the system analyst job description is in this article.

System Analyst Job Description

The job description of a system analyst is:

A system analyst looks at existing IT systems to analyse, design, and implement new IT solutions, or modify existing IT solutions.

That’s the short answer. If you’ve been around IT for any length of time, you might have seen people or worked with people who fit this description. They also might seem similar to business analysts – but we’ll get to that later.

 

What Does A System Analyst Do?

A job description is helpful to know at a high level what your role is. But, what does a system analyst actually do?

Some of the tasks or jobs that they can do are:

  • Analyse existing IT systems
  • Perform requirements analysis
  • Translate the business “speak” or the business problem into technical or project requirements
  • Speak with internal and external stakeholders and team members (developers, other business analysts and system analysts, testers, business representatives)
  • Understand the software development life cycle
  • Document the interfaces in new and existing or legacy systems
  • Help determine the time and cost involved in developing a solution
  • Presenting or contributing to a solution discussion with the client and business representatives
  • Working closely with the project manager to determine and adhere to the timeline, costs, and identify risks and issues
  • Write, or contribute to, a technical requirements document
  • Work with designers and developers to create a solution to match the business requirements
  • Perform system testing
  • Help implement the solution
  • Document the process or solution

These tasks are often listed along with the system analyst job description in job posts. Does this line up to what you actually do as a system analyst? Does it help to understand what a system analyst actually does if you’re not a system analyst?

 

What Is The Difference Between a System Analyst and a Business Analyst?

The job description and tasks listed above seem quite similar to those of a business analyst. Also, my current role as a business analyst means I do many of these tasks as well.

So how does it differ from a business analyst? Is this another case of two job titles meaning the same thing?

Well, they’re actually a bit different. The “systems analyst” role sits more on the IT side of the “business/IT” divide. They are usually more technical and have a background in software development, kind of like a technical business analyst. The tasks listed above around “writing technical requirements documents” and “performing system testing” are not usually done by a business analyst, but they’re perfectly normal tasks for a system analyst.

The “business analyst” sits more on the business side of the “business/IT” divide. They are responsible for understanding the business process and business problems, and don’t necessarily need an IT background (thought it helps, I can assure you). They may spend more time gathering requirements and working with the business stakeholders than a system analyst, but less time looking at the system and would never write code or technical requirements.

great post by Laura Brandenburg over at Bridging the Gap explains this in more detail.

 

What Skills Does A System Analyst Need?

Similar to a business analyst, there are several skills that are desirable for system analysts to have, and are often listed along with the system analyst job description in job posts:

  • Strong analysis skills
  • Strong written and verbal communication skills
  • Knowledge of programming concepts, such as testing, maintenance, development process, architecture
  • Experience in one or more programming languages is helpful

These skills are similar to that of a business analyst, but are more technical.

The most important ones are analysis and communication, which are essential to their job. What use is a system analyst who can’t analyse, or communicate with others? This is a fundamental part of their role.

Programming concepts are also needed, and because they work more on the IT side of the project, they need to be able to understand the developers and work with them to design a solution that meets their requirements. They also need to be able to translate what the developers have said into terms that the business stakeholders can understand.

 

Well, I hope this article has helped you understand what a system analyst does and the system analyst job description.

Do you have any questions on this role? Share them in the comments section below!

Career Action Tip: If you’re interested in becoming a systems analyst, evaluate your analysis skills, communication skills, and programming experience against the requirements of a system analyst. Look on some job boards for system analyst roles and see how you meet the criteria for these roles.

Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!

Image courtesy of David Castillo Dominici / FreeDigitalPhotos.net

]]>
http://www.completeitprofessional.com/system-analyst-job-description/feed/ 2