SQL Server Substring with CharIndex
In this article we are going to explore the T-SQL function CharIndex and also how to use it with another T-SQL function Substring(). CharIndex: This function returns the location of a substring in a...
View ArticleT-SQL: RIGHT, LEFT, SUBSTRING and CHARINDEX Functions
This article explains the functionality and uses of the LEFT, RIGHT, SUBSTRING and CHARINDEX functions in SQL. This article will leave you with sound knowledge and understanding that you can take away...
View ArticleSQL and Data. Learning to Retrieve Data Efficiently and Accurately
Execute SQL*Plus Type describe billing_accounts Type desc orders Type SELECT???? FROM billing_accounts bact, orders ord WHERE bact.id = ord.bact_id AND substr(ord.name,1,3) = 715 AND bact.rentyp_id...
View ArticleSQL - String Functions
SQL> UPDATE table_test -> SET blob_col=LOAD_FILE('/tmp/picture') -> WHERE id=1; ..... The first syntax returns the position of the first occurrence of substring substr in string str. The...
View ArticleTop 5 T-SQL functions introduced in SQL Server 2016
Prior to the release of SQL Server 2016, many developers made used of user defined ... 1 INSERT INTO @output (splitdata) VALUES(SUBSTRING(@string, @start, @end - @start)) SET @start = @end + 1 SET @end...
View ArticleSQL Server 2012: T-SQL Code Snippets
Author> Expansion <![CDATA[ --Author: Saleem Hakani (Microsoft Corporation) --Website: Http://sqlcommunity.com Select 'Login Name'= Substring(upper(SUSER ...
View ArticleExtracting data from journals using SQL
inz(%elem(Jrn)) ; 17 exec sql DECLARE C0 CURSOR FOR 18 SELECT ENTRY_TIMESTAMP,JOURNAL_CODE,JOURNAL_ENTRY_TYPE, 19 JOB_NAME,JOB_USER,JOB_NUMBER,SUBSTR(OBJECT,1,10), 20...
View ArticleIDNameObjects API
By default (implicitly), when you pass the string "search" parameter in IDNameObjects API methods, it means that the [Name] property should contain this parameter as a substring ... Naturally, it is...
View ArticleTop 80 + SQL Query Interview Questions and Answers with Examples
Oracle Equivalent of SQL Server SUBSTRING is SUBSTR, Query : select substr(FIRST_NAME,0,3) from employee SQL Server Equivalent of Oracle SUBSTR is SUBSTRING, Query : select substring(FIRST_NAME,1,3)...
View ArticleSQL and Data. Learning to Retrieve Data Efficiently and Accurately
Execute SQL*Plus Type describe billing_accounts Type desc orders Type SELECT???? FROM billing_accounts bact, orders ord WHERE bact.id = ord.bact_id AND substr(ord.name,1,3) = 715 AND bact.rentyp_id...
View ArticleTechTip: C# for RPGers: Not All Strings Are Born Equal
Substring is very similar to an RPG BIF ... His areas of expertise include programming in the IBM i native languages (RPG, CL, and DB2 SQL) and "modern" programming languages, such as C# and Python, as...
View ArticlePattern Matching : More Fun When I Was a #Kid
In one case, the person cited an article by David Lozinski, "SQL: LIKE vs SUBSTRING vs LEFT/RIGHT vs CHARINDEX." Yes, the article shows that, in the contrived example, CHARINDEX performed best....
View ArticleTop 5 T-SQL functions introduced in SQL Server 2016
Prior to the release of SQL Server 2016, many developers made used of user defined ... 1 INSERT INTO @output (splitdata) VALUES(SUBSTRING(@string, @start, @end - @start)) SET @start = @end + 1 SET @end...
View ArticleComparing SQL Server and MySQL Functions
You’ll be happy to know that the following functions are usable in both MySQL and SQL Server queries without any modifications: ASCII, LEFT, LOWER, LTRIM, REPLACE, REVERSE, RIGHT, RTRIM, SOUNDEX,...
View ArticleSQL Server 2012: T-SQL Code Snippets
Author> Expansion <![CDATA[ --Author: Saleem Hakani (Microsoft Corporation) --Website: Http://sqlcommunity.com Select 'Login Name'= Substring(upper(SUSER ...
View ArticleSQL - String Functions
SQL> UPDATE table_test -> SET blob_col=LOAD_FILE('/tmp/picture') -> WHERE id=1; ..... The first syntax returns the position of the first occurrence of substring substr in string str. The...
View ArticleT-SQL: RIGHT, LEFT, SUBSTRING and CHARINDEX Functions
This article explains the functionality and uses of the LEFT, RIGHT, SUBSTRING and CHARINDEX functions in SQL. This article will leave you with sound knowledge and understanding that you can take away...
View ArticleOracle SUBSTR Function Explained with Examples
The Oracle SUBSTR function is used to get a smaller string (the substring ... The only way that I know of to get a SUBSTR from a LONG variable is to write a PL/SQL procedure that takes a ROWID, then...
View ArticleTop 80 + SQL Query Interview Questions and Answers with Examples
Oracle Equivalent of SQL Server SUBSTRING is SUBSTR, Query : select substr(FIRST_NAME,0,3) from employee SQL Server Equivalent of Oracle SUBSTR is SUBSTRING, Query : select substring(FIRST_NAME,1,3)...
View ArticleOptimizing SQL Server CPU Performance
For more information on SQL traces, see msdn2.microsoft.com/ms191006.aspx. SELECT substring(text,qs.statement_start_offset/2 ,(CASE WHEN qs.statement_end_offset = -1 THEN len(convert(nvarchar(max),...
View Article