Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
SQL Server 119
#SQLServer 88
Oracle 70
#SQL SERVER 35
BRH 31
SQL Server 2012 29
denali 23
#TSQL 19
TSQL 19
C# 15

Archive · View All
October 2011 31
November 2011 30
September 2011 30
August 2011 18
December 2011 15
July 2011 13
June 2011 8
May 2012 4
April 2012 3
January 2010 3

Day 1: String Concatenation in Oracle

Sep 13 2011 11:50PM by Niladri Biswas   

Let Us Learn Oracle - Part 1 of N [ String Concatenation in Oracle ]

Source table: tblPlayers

In Oracle concatenation can be done in the following ways

Option 1: Using Concatenation Operator ( || )


SQL> Select PlayerFirstName || ' ' || PlayerLastName FullName From tblPlayers;

FULLNAME
---------------------
A Raman
B Kadir
C Nadir
D Das
E Punchkar
F Fateman
G Gajani
H Hariharan
I Ikat
J Jwar

10 rows selected.

Option 2: Using CONCAT function

SQL> Select Concat(PlayerFirstName,PlayerLastName) FullName From tblPlayers;

FULLNAME
--------------------
ARaman
BKadir
CNadir
DDas
EPunchkar
FFateman
GGajani
HHariharan
IIkat
JJwar

10 rows selected.

However, this function has a limitation as it cannot accept more than 2 arguments. Infact, it accepts precisely 2 arguments.Henceforth, the below statement will fail

SQL> Select Concat(PlayerFirstName, ' ',PlayerLastName) FullName From tblPlayers;
Select Concat(PlayerFirstName, ' ',PlayerLastName) FullName From tblPlayers
       *
ERROR at line 1:
ORA-00909: invalid number of arguments

But we can culminate this by "Nesting" the CONCAT function as shown under

SQL> Select Concat(PlayerFirstName,Concat(' ' ,PlayerLastName))FullName From tblPlayers;

FULLNAME
---------------------
A Raman
B Kadir
C Nadir
D Das
E Punchkar
F Fateman
G Gajani
H Hariharan
I Ikat
J Jwar

10 rows selected.

N.B.~Unlike Sql Server, we cannot use the '+' operator here for concatenation. It will throw error

SQL> Select PlayerFirstName + ' ' + PlayerLastName FullName From tblPlayers;
Select PlayerFirstName + ' ' + PlayerLastName FullName From tblPlayers
       *
ERROR at line 1:
ORA-01722: invalid number

Concatenation in Sql Server

Before Denali, we had only one way i.e. by using '+' operator

Select PlayerFirstName + ' ' + PlayerLastName FullName From tblPlayers

But with the advent of Denali CTP3, we can use the Concat function also as

Select Concat(PlayerFirstName,' ' ,PlayerLastName)FullName From tblPlayers

Thanks for reading

Tags: #SQLServer, SQL Server, Oracle,


Niladri Biswas
7 · 21% · 6710
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

9  Comments  

  • I always wanted to learn some basics of ORACLE. Looks like a good opportunity and resource. I am going to follow your posts closely and build some ORACLE skills :-)

    commented on Sep 15 2011 12:13PM
    Jacob Sebastian
    1 · 100% · 32220
  • Good series....I too thought of learning ORACLE...

    Happy to see CONCAT in SQL Server Denali is more powerful than the one in ORACLE, as ORACLE CONCAT() function is accepting only 2 arguments...

    commented on Sep 15 2011 12:22PM
    Ramireddy
    2 · 40% · 12972
  • Thanks a lot that it will help all of us. Also if u guys found something new please add it to the series. The objective of this Oracle series is to help all the community members.

    commented on Sep 15 2011 9:58PM
    Niladri Biswas
    7 · 21% · 6710
  • Learning is always good idea and I am going to follow this series for additional learning.

    What I like the most is the alternative suggested for SQL Server and Denali also in focus.

    Can you believe co-incidence - I wrote about CONCAT function just today (http://wp.me/p2NUQ-3Ka) and now I just noticed your post.

    Encouraging.

    commented on Sep 15 2011 10:14PM
    Pinal Dave
    148 · 1% · 326
  • well, I have stopped working with ORACLE since last few years, so your series of articles in ORACLE will brush up my memory for sure. Thanks. :) keep it up.

    commented on Sep 15 2011 10:16PM
    Ritesh Shah
    75 · 2% · 747
  • Initially I started with Oracle but stopped working with Oracle since last 5 years. So need to brush up the skill :)

    Thanks for sharing. Keep it up.

    commented on Sep 15 2011 11:17PM
    Hardik Doshi
    20 · 9% · 2845
  • Your post gave me memories of the project that I worked with ODO.NET.

    ORACLE is good, but I still love SQL Server.

    CAn we turn off case sensitive nature of ORACLE in latest version?

    commented on Sep 16 2011 1:20AM
    Hima
    31 · 6% · 1776
  • This is interesting. I have never really worked with ORACLE, although I have helped a couple of people indirectly. When faced with an ORACLE question, I would always say "In SQL Server, we normally do so and so. Therefore, there has to be an equivalent available in ORACLE. Now that I have told you the concept of what needs to be done, will you look into the documentation?".

    I intend to continue following this series to gain an insight on the workings of ORACLE. But, one thing is great about these posts, and that is they provide a direct head-on comparison between the two major RDBMS systems.

    By the way, being a hard-core SQL Server guy, it's great to know that SQL Server is catching up, and in the process overcoming the limitations of ORACLE!

    commented on Sep 18 2011 5:19AM
    Nakul Vachhrajani
    4 · 36% · 11521

Your Comment


Sign Up or Login to post a comment.

"Day 1: String Concatenation in Oracle" rated 5 out of 5 by 2 readers
Day 1: String Concatenation in Oracle , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]