General posts

Set and Use Environment Variable inside Python Script

It is somewhat difficult when it comes to setting and using bash environment variables in python script file. The same step is very easy and straight forward using shell script. In this post, we will check one of the method to set and use environment variable inside python scrip file. Note that, steps mentioned in this post helps only if you are setting and using that variable inside same process i.e. in same python script. There is no way you can modify bash script from python and use that variable…

Continue ReadingSet and Use Environment Variable inside Python Script
Comments Off on Set and Use Environment Variable inside Python Script

How Column Oriented Database Stores Data? – Details

Column-oriented databases save their data grouped by columns. Subsequent column values are stored contiguously on disk. Columnar storage for database tables is one of an important factor in optimizing analytic query performance in the database.In this article, we will check how column oriented database stores data. Also we will check the difference between row oriented database and columnar database - columnar database vs document database What is Column Oriented Database? The column-oriented databases save their data grouped by columns. This differs from the usual row-oriented approach of traditional databases, which…

Continue ReadingHow Column Oriented Database Stores Data? – Details
Comments Off on How Column Oriented Database Stores Data? – Details

Teradata WITH Clause Syntax, Usage and Examples

Teradata WITH Clause is an optional clause that always precedes SELECT clause in the query statements. Each subquery in the WITH clause specifies a table name, an optional list of column names, and a query expression that evaluates to a table (usually a SELECT statement). In SQL, WITH clause are commonly referred to as Common Table Expressions (CTE). Teradata WITH Clause WITH clause is used for many purposes, if you want to find our hierarchy in the data then recursive WITH clause is used. If your requirement is to reuse…

Continue ReadingTeradata WITH Clause Syntax, Usage and Examples
Comments Off on Teradata WITH Clause Syntax, Usage and Examples

Teradata Split Delimited Fields into Table Records and Examples

If you are working on the huge amount of different source system then you may come across the requirement of Teradata split delimited fields into table records. You can perform Teradata split delimited string into columns in various ways using Teradata built-in string functions or Teradata regular expressions. You can use any of the below methods as per your requirements: Teradata Split Delimited fields using STRTOK_SPLIT_TO_TABLE Function  Since TD14, there is a STRTOK_SPLIT_TO_TABLE function. You can use this function to split your string or delimited field into table columns. Teradata…

Continue ReadingTeradata Split Delimited Fields into Table Records and Examples
Comments Off on Teradata Split Delimited Fields into Table Records and Examples

Teradata Regular Expressions and Examples

The Teradata regular expressions functions identify precise patterns of characters and are useful for extracting string from the data and validation of the existing data, for example, validate date, range checks, checks for characters, and extract specific characters from the data. In this article, we will check some of commonly used Teradata regular expressions. Read: Teradata String Functions and Examples Commonly used Teradata date functions and Examples Teradata Substring Regular Expression - REGEXP_SUBSTR This function is used to extracts a substring from source_string that matches a regular expression specified by…

Continue ReadingTeradata Regular Expressions and Examples
Comments Off on Teradata Regular Expressions and Examples

Teradata String Functions and Examples

Teradata String Functions are primarily used for various string manipulation. It also supports most of the standard string function along with the Teradata extension to those functions. Teradata String Functions Below are the commonly used Teradata string functions: Read: Teradata Regular Expressions and Examples Teradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS Commonly used Teradata Analytics Functions and Examples Teradata Date Functions and Examples Function Description concat(string1, ..., stringN) Returns the concatenation of two or more string values. This function provides the same functionality as the SQL-standard concatenation operator (||). length(string) Returns…

Continue ReadingTeradata String Functions and Examples
2 Comments

Teradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS

You can use the Teradata set operators to combine similar data sets from two or more SELECT statements in the query. The data types of the columns which are being used in the Teradata SET operators should match or explicitly type cast column values to required data types. The SET operators are similar to the JOINs, the only difference is that join combines the columns from different tables whereas SET operators combine rows from different tables. Read: Teradata String Functions and Examples Commonly used Teradata Date Functions and Examples Teradata…

Continue ReadingTeradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS
Comments Off on Teradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS

Commonly used Teradata Date Functions and Examples

This article is about detailed descriptions and examples of the commonly used Teradata date functions that you can use to manipulate date columns in the Teradata, stored procedure or in embedded SQLs. In the real word scenario, many application manipulate the date and time data types. Date types are highly formatted and very complicated. Each date value contains the century, year, month, day, hour, minute, and second. Each RDBMS may employ different date functions, and there may also be differences in the syntax for each RDBMS even when the function…

Continue ReadingCommonly used Teradata Date Functions and Examples
Comments Off on Commonly used Teradata Date Functions and Examples

Netezza Select Random Rows and Example

If you are working on data warehouse or any database query then you might have received the request to get random numbers based on on some key columns. In this article, we will check Netezza select random rows in nzsql and explanation with an examples. This article also explains you on Netezza select random samples that you may use in other client related applications. Netezza Select Random Rows To demonstrate the Netezza select random, we will use the Netezza random() built in function. Netezza Select Random Rows Example  Suppose you…

Continue ReadingNetezza Select Random Rows and Example
2 Comments

How Teradata Data Distribution Works on AMPs?

This article is about how Teradata data distribution works on the various AMP's present in the Teradata system. What is AMP? Before going in detail in the Teradata data distribution, lets check what AMP is? AMP, acronym for Access Module Processor, is the Virtual Processor (vproc) used to manage the database, handle file tasks and and manipulate the disk subsystem in the multi-tasking and possibly parallel-processing environment of the Teradata Database. Each AMP then contained its own microprocessor, disk drive, file system, database software (Database Manager), Teradata Operating System (TOS),…

Continue ReadingHow Teradata Data Distribution Works on AMPs?
Comments Off on How Teradata Data Distribution Works on AMPs?