SlideShare a Scribd company logo
Kumar Krishnan
Thanks to
 Shivakumar .U
 Sunil V.M
 Lokesh
 Spoorthi
 Job John
 Vinod Raj
 Perform operations on a string (char or
varchar) input value and return a string or
numeric value.
 In simple Terms the STRING FUNCTIONS are used
to used primarily for string manipulation
 ASCII
 CHAR
 SUBSTR-(SUBSTRING)
 REPLACE
 REPLICATE
 UPPER
 LEN-(LENGTH)
 CHARINDEX
 PATINDEX
 LEFT
 RIGHT
 LOWER
 LTRIM
 STUFF
 DIFFERENCE
 CONCAT
 UNICODE
 SPACE
 STR
 UNICODE
 SOUNDEX
 QOUTENAME
 NCHAR
 RTRIM
 REVERSE
 ASCII : ASCII (character_expression)
Arguments: Is an expression of the type char or varchar.
Returns: INT
Ex: SELECT ASCII (‘A’) ------ Returns: 97
 CHAR : CHAR (character_expression)
Arguments: Is an integer from 0 through 255. NULL is returned
if the integer expression is not in this range.
Returns : CHAR
Ex: SELECT CHAR (101) ----- Returns: E.
 CHARINDEX ( expressionToFind ,expressionToSearch , start location )
Arguments:
expressionToFind
Is a character expression that contains the sequence to be found.
expressionToFind is limited to 8000 characters.
expressionToSearch
Is a character expression to be searched.
start location
Is an integer or bigint expression at which the search starts. If start
location is not specified, is a negative number, or is 0, the search
starts at the beginning of expressionToSearch.
Return Types:
bigint if expressionToSearch is of the varchar(max), nvarchar(max), or
varbinary(max) data types; otherwise, int.
Ex: SELECT CHARINDEX ('k','kumar',1) ------ 1
 CONCAT : CONCAT(string_value1,string_value2,[string value])
Arguments:
String value
A string value to concatenate to the other values.
Return:
String, the length and type of which depend on the input.
Ex : SELECT CONCAT ( 'Happy ', 'Birthday ', 11, '/', '25‘)
Note : CONCAT is Available in the SQL Server 2012
 DIFFERENCE ( character_expression , character_expression)
Arguments:
character_expression
Is an alphanumeric expression of character data.
character_expression can be a constant, variable, or column.
Returns:
INT
Ex: SELECT DIFFERENCE ( ‘Kumar’ , ‘umar’ ) ----- 3
The return value ranges from 0 through 4: 0 indicates weak or
no similarity, and 4 indicates strong similarity or the same
values.
 LEFT : (character_expression , integer_expression)
Arguments:
character_expression
Is an expression of character or binary data.
integer_expression
Is a positive integer that specifies how many characters of the
character_expression will be return
Return Types:
Returns varchar when character_expression is a non-Unicode
character data type.
Returns nvarchar when character_expression is a Unicode
character data type.
Ex : SELECT LEFT(‘KUMAR’,3) ----- KUM
 RIGHT : RIGHT (character_expression , integer_expression)
Arguments
character_expression
Is an expression of character or binary data.
character_expression can be a constant, variable, or column.
Integer_expression
Is a positive integer that specifies how many characters of
character_expression will be returned
Return Types
Returns varchar when character_expression is a non-Unicode
character data type.
Returns nvarchar when character_expression is a Unicode
character data type.
Ex: SELECT RIGHT(‘KUMAR’,3) ----- MAR
 LEN : LEN(( string expression )
Arguments
string expression
Is the string expression to be evaluated. string expression can
be a constant, variable, or column of either character or
binary data.
Return Types
bigint if expression is of the varchar(max), nvarchar(max) or
varbinary(max) data types; otherwise, int.
EX: SELECT LEN ( ‘KUMAR’) ------ 5
 LTRIM : LTRIM ( character_expression )
Arguments
character_expression
Is an expression of character or binary data.
character_expression can be a constant, variable, or column.
Return Type
varchar or nvarchar
Ex: SELECT LTRIM (‘ KUMAR’) --- KUMAR
 REPLACE: REPLACE( string,string_pattern,string_replacement)
Arguments
string_expression
Is the string expression to be searched. string_expression can be of a
character or binary data type.
string pattern
Is the substring to be found. string pattern can be of a character or
binary data type.
string replacement
Is the replacement string. string replacement can be of a character or
binary data type.
Return Types
Returns nvarchar if one of the input arguments is of the nvarchar data
type.
Ex: SELECT (‘KUMAR’,’U’,’UU’) ---- KUUMAR
 SUBSTRING : SUBSTRING ( expression ,start , length )
Arguments:
Expression Is a character, binary, text, ntext, or image
expression.
start
Is an integer or bigint expression that specifies where the
returned characters start. If start is less than 1,
length
Is a positive integer or bigint expression that specifies how
many characters of the expression will be returned.
Return Types
Returns character data if expression is one of the supported
character data types
Ex: SELECT SUBSTRING ( ‘MY NAME IS KUMAR’ ,3,3) ---- NAM
 STUFF:STUFF (character_expression, start, length, replace_exprn)
Arguments
Is an expression of character data. character_expression can be a
constant, variable, or column of either character or binary data.
start
Is an integer value that specifies the location to start deletion and
insertion
length
Is an integer that specifies the number of characters to delete
Replace expression
Is an expression of character data. character_expression can be a
constant, variable, or column of either character or binary data
Ex: SELECT STUFF( ‘KUMAR’,1,3,’NAMASK’ ) ------NAMASKAR
String functions

More Related Content

What's hot

Programming fundamental
Programming fundamentalProgramming fundamental
Programming fundamental
Mukesh Thakur
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
Danny Bryant
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
Dattatray Gandhmal
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raj Gupta
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
Prof. Wim Van Criekinge
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
Bharat17485
 
Ch3
Ch3Ch3
Andrei's Regex Clinic
Andrei's Regex ClinicAndrei's Regex Clinic
Andrei's Regex Clinic
Andrei Zmievski
 
5 the relational algebra and calculus
5 the relational algebra and calculus5 the relational algebra and calculus
5 the relational algebra and calculus
Kumar
 
Patterns
PatternsPatterns
Patterns
Gayathri91098
 
16 Java Regex
16 Java Regex16 Java Regex
16 Java Regex
wayn
 
Regular expression
Regular expressionRegular expression
Regular expression
Larry Nung
 
Regular expression
Regular expressionRegular expression
Regular expression
Rajon
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
mussawir20
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
Ben Brumfield
 
Regular expression
Regular expressionRegular expression
Regular expression
MONIRUL ISLAM
 
C - String ppt
C - String ppt C - String ppt
C - String ppt
Md Razib
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Ratnakar Mikkili
 
Problemset
ProblemsetProblemset
Problemset
yonsei
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
Lambert Lum
 

What's hot (20)

Programming fundamental
Programming fundamentalProgramming fundamental
Programming fundamental
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Ch3
Ch3Ch3
Ch3
 
Andrei's Regex Clinic
Andrei's Regex ClinicAndrei's Regex Clinic
Andrei's Regex Clinic
 
5 the relational algebra and calculus
5 the relational algebra and calculus5 the relational algebra and calculus
5 the relational algebra and calculus
 
Patterns
PatternsPatterns
Patterns
 
16 Java Regex
16 Java Regex16 Java Regex
16 Java Regex
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
 
Regular expression
Regular expressionRegular expression
Regular expression
 
C - String ppt
C - String ppt C - String ppt
C - String ppt
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Problemset
ProblemsetProblemset
Problemset
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 

Viewers also liked

String functions and operations
String functions and operations String functions and operations
String functions and operations
Mudasir Syed
 
String operation
String operationString operation
String operation
Shakila Mahjabin
 
C string
C stringC string
Strings in C
Strings in CStrings in C
Strings in C
Kamal Acharya
 
C programming - String
C programming - StringC programming - String
C programming - String
Achyut Devkota
 
String
StringString
String
Kishan Gohel
 
Algorithm Designs - Control Structures
Algorithm Designs - Control StructuresAlgorithm Designs - Control Structures
Algorithm Designs - Control Structures
hatredai
 

Viewers also liked (7)

String functions and operations
String functions and operations String functions and operations
String functions and operations
 
String operation
String operationString operation
String operation
 
C string
C stringC string
C string
 
Strings in C
Strings in CStrings in C
Strings in C
 
C programming - String
C programming - StringC programming - String
C programming - String
 
String
StringString
String
 
Algorithm Designs - Control Structures
Algorithm Designs - Control StructuresAlgorithm Designs - Control Structures
Algorithm Designs - Control Structures
 

Similar to String functions

Python strings
Python stringsPython strings
Python strings
Mohammed Sikander
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
Logan Palanisamy
 
MySQL String Functions.pptx
MySQL String Functions.pptxMySQL String Functions.pptx
MySQL String Functions.pptx
MayankSharma867296
 
MySQL String Functions.docx
MySQL String Functions.docxMySQL String Functions.docx
MySQL String Functions.docx
RUBAB79
 
Strings in c++
Strings in c++Strings in c++
Java Object Orientend Programming 1.pptx
Java Object Orientend Programming 1.pptxJava Object Orientend Programming 1.pptx
Java Object Orientend Programming 1.pptx
OmarBinkasimSefat
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
Amrit Kaur
 
string functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptxstring functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptx
ujjwalmatoliya
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
SanthiyaAK
 
Oracle sql functions
Oracle sql functionsOracle sql functions
Oracle sql functions
Vivek Singh
 
String function in my sql
String function in my sqlString function in my sql
String function in my sql
knowledgemart
 
Write a class of static methods that accomplish the following tasks. .docx
 Write a class of static methods that accomplish the following tasks. .docx Write a class of static methods that accomplish the following tasks. .docx
Write a class of static methods that accomplish the following tasks. .docx
ajoy21
 
Functions
FunctionsFunctions
Functions
Ankit Dubey
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 
Computer programming 2 Lesson 11
Computer programming 2  Lesson 11Computer programming 2  Lesson 11
Computer programming 2 Lesson 11
MLG College of Learning, Inc
 
Python programming unit 2 -Slides-3.ppt
Python programming  unit 2 -Slides-3.pptPython programming  unit 2 -Slides-3.ppt
Python programming unit 2 -Slides-3.ppt
geethar79
 
Constants
ConstantsConstants
Constants
Tech_MX
 
Strings
StringsStrings
Strings
Imad Ali
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular Expressions
Mukesh Tekwani
 
Regular_Expressions.pptx
Regular_Expressions.pptxRegular_Expressions.pptx
Regular_Expressions.pptx
DurgaNayak4
 

Similar to String functions (20)

Python strings
Python stringsPython strings
Python strings
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
 
MySQL String Functions.pptx
MySQL String Functions.pptxMySQL String Functions.pptx
MySQL String Functions.pptx
 
MySQL String Functions.docx
MySQL String Functions.docxMySQL String Functions.docx
MySQL String Functions.docx
 
Strings in c++
Strings in c++Strings in c++
Strings in c++
 
Java Object Orientend Programming 1.pptx
Java Object Orientend Programming 1.pptxJava Object Orientend Programming 1.pptx
Java Object Orientend Programming 1.pptx
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
 
string functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptxstring functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptx
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
 
Oracle sql functions
Oracle sql functionsOracle sql functions
Oracle sql functions
 
String function in my sql
String function in my sqlString function in my sql
String function in my sql
 
Write a class of static methods that accomplish the following tasks. .docx
 Write a class of static methods that accomplish the following tasks. .docx Write a class of static methods that accomplish the following tasks. .docx
Write a class of static methods that accomplish the following tasks. .docx
 
Functions
FunctionsFunctions
Functions
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Computer programming 2 Lesson 11
Computer programming 2  Lesson 11Computer programming 2  Lesson 11
Computer programming 2 Lesson 11
 
Python programming unit 2 -Slides-3.ppt
Python programming  unit 2 -Slides-3.pptPython programming  unit 2 -Slides-3.ppt
Python programming unit 2 -Slides-3.ppt
 
Constants
ConstantsConstants
Constants
 
Strings
StringsStrings
Strings
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular Expressions
 
Regular_Expressions.pptx
Regular_Expressions.pptxRegular_Expressions.pptx
Regular_Expressions.pptx
 

Recently uploaded

Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 

Recently uploaded (20)

Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 

String functions

  • 2. Thanks to  Shivakumar .U  Sunil V.M  Lokesh  Spoorthi  Job John  Vinod Raj
  • 3.  Perform operations on a string (char or varchar) input value and return a string or numeric value.  In simple Terms the STRING FUNCTIONS are used to used primarily for string manipulation
  • 4.  ASCII  CHAR  SUBSTR-(SUBSTRING)  REPLACE  REPLICATE  UPPER  LEN-(LENGTH)  CHARINDEX  PATINDEX  LEFT  RIGHT  LOWER  LTRIM
  • 5.  STUFF  DIFFERENCE  CONCAT  UNICODE  SPACE  STR  UNICODE  SOUNDEX  QOUTENAME  NCHAR  RTRIM  REVERSE
  • 6.  ASCII : ASCII (character_expression) Arguments: Is an expression of the type char or varchar. Returns: INT Ex: SELECT ASCII (‘A’) ------ Returns: 97  CHAR : CHAR (character_expression) Arguments: Is an integer from 0 through 255. NULL is returned if the integer expression is not in this range. Returns : CHAR Ex: SELECT CHAR (101) ----- Returns: E.
  • 7.  CHARINDEX ( expressionToFind ,expressionToSearch , start location ) Arguments: expressionToFind Is a character expression that contains the sequence to be found. expressionToFind is limited to 8000 characters. expressionToSearch Is a character expression to be searched. start location Is an integer or bigint expression at which the search starts. If start location is not specified, is a negative number, or is 0, the search starts at the beginning of expressionToSearch. Return Types: bigint if expressionToSearch is of the varchar(max), nvarchar(max), or varbinary(max) data types; otherwise, int. Ex: SELECT CHARINDEX ('k','kumar',1) ------ 1
  • 8.  CONCAT : CONCAT(string_value1,string_value2,[string value]) Arguments: String value A string value to concatenate to the other values. Return: String, the length and type of which depend on the input. Ex : SELECT CONCAT ( 'Happy ', 'Birthday ', 11, '/', '25‘) Note : CONCAT is Available in the SQL Server 2012
  • 9.  DIFFERENCE ( character_expression , character_expression) Arguments: character_expression Is an alphanumeric expression of character data. character_expression can be a constant, variable, or column. Returns: INT Ex: SELECT DIFFERENCE ( ‘Kumar’ , ‘umar’ ) ----- 3 The return value ranges from 0 through 4: 0 indicates weak or no similarity, and 4 indicates strong similarity or the same values.
  • 10.  LEFT : (character_expression , integer_expression) Arguments: character_expression Is an expression of character or binary data. integer_expression Is a positive integer that specifies how many characters of the character_expression will be return Return Types: Returns varchar when character_expression is a non-Unicode character data type. Returns nvarchar when character_expression is a Unicode character data type. Ex : SELECT LEFT(‘KUMAR’,3) ----- KUM
  • 11.  RIGHT : RIGHT (character_expression , integer_expression) Arguments character_expression Is an expression of character or binary data. character_expression can be a constant, variable, or column. Integer_expression Is a positive integer that specifies how many characters of character_expression will be returned Return Types Returns varchar when character_expression is a non-Unicode character data type. Returns nvarchar when character_expression is a Unicode character data type. Ex: SELECT RIGHT(‘KUMAR’,3) ----- MAR
  • 12.  LEN : LEN(( string expression ) Arguments string expression Is the string expression to be evaluated. string expression can be a constant, variable, or column of either character or binary data. Return Types bigint if expression is of the varchar(max), nvarchar(max) or varbinary(max) data types; otherwise, int. EX: SELECT LEN ( ‘KUMAR’) ------ 5
  • 13.  LTRIM : LTRIM ( character_expression ) Arguments character_expression Is an expression of character or binary data. character_expression can be a constant, variable, or column. Return Type varchar or nvarchar Ex: SELECT LTRIM (‘ KUMAR’) --- KUMAR
  • 14.  REPLACE: REPLACE( string,string_pattern,string_replacement) Arguments string_expression Is the string expression to be searched. string_expression can be of a character or binary data type. string pattern Is the substring to be found. string pattern can be of a character or binary data type. string replacement Is the replacement string. string replacement can be of a character or binary data type. Return Types Returns nvarchar if one of the input arguments is of the nvarchar data type. Ex: SELECT (‘KUMAR’,’U’,’UU’) ---- KUUMAR
  • 15.  SUBSTRING : SUBSTRING ( expression ,start , length ) Arguments: Expression Is a character, binary, text, ntext, or image expression. start Is an integer or bigint expression that specifies where the returned characters start. If start is less than 1, length Is a positive integer or bigint expression that specifies how many characters of the expression will be returned. Return Types Returns character data if expression is one of the supported character data types Ex: SELECT SUBSTRING ( ‘MY NAME IS KUMAR’ ,3,3) ---- NAM
  • 16.  STUFF:STUFF (character_expression, start, length, replace_exprn) Arguments Is an expression of character data. character_expression can be a constant, variable, or column of either character or binary data. start Is an integer value that specifies the location to start deletion and insertion length Is an integer that specifies the number of characters to delete Replace expression Is an expression of character data. character_expression can be a constant, variable, or column of either character or binary data Ex: SELECT STUFF( ‘KUMAR’,1,3,’NAMASK’ ) ------NAMASKAR