How to Generate Teradata Object DDL? – Tables,Views,UDF,SP,Macros

Teradata database is one of the widely used relational databases. The Teradata system is available on premises and cloud version. Teradata supports many useful tools such as Fast Export, Fast Load, BTEQ, etc. But, there are no tools to pull object DDL's from the Teradata database. In this article, we will check one of the administrative tasks, How to Generate Teradata Object DDL using System Tables and show command. We will generate DDL's for Teradata objects such as tables, views, stored procedures, macros and user defined functions. How to Generate…

Continue ReadingHow to Generate Teradata Object DDL? – Tables,Views,UDF,SP,Macros
Comments Off on How to Generate Teradata Object DDL? – Tables,Views,UDF,SP,Macros

Commonly used Teradata BTEQ commands and Examples

The BTEQ stands for Basic Teradata Query is one of the commonly used tools to interact with Teradata server. BTEQ tool was the original way that SQL was submitted to Teradata as a means of getting an answer in a desired format. In this article, we will check commonly used Teradata BTEQ commands with some examples. Commonly used Teradata BTEQ commands Following BTEQ commands are commonly used when writing scripts. BTEQ CommandDescription=Repeats the previous Teradata SQL request a specified number of times.AUTOKEYRETRIEVEThis control enables users to specify whether the database…

Continue ReadingCommonly used Teradata BTEQ commands and Examples
Comments Off on Commonly used Teradata BTEQ commands and Examples

Teradata Extract Function Syntax and Example

The extract function in Teradata extracts date or time part of the date, time, timestamp, or interval fields. The extract function retrieves the sub part such as day, month, year, etc. This extract function is equivalent to date_part() function in other relational databases. In this article, we will check how to use an extract function to get specified subpart. The extract function also converts the extracted value exact numeric format. The output is always a numeric value. Teradata Extract Function In a data warehouse, you will be working with many…

Continue ReadingTeradata Extract Function Syntax and Example
Comments Off on Teradata Extract Function Syntax and Example

What is isnull Alternative in Teradata SQL?

The relational databases such as SQL server supports isnull function. It returns the alternate value if input argument or expression is null. But, Teradata does not support isnull function. Instead, you have to use an alternate method to replace null values. In this article, we will check what is isnull alternative in Teradata SQL with some examples. isnull Function Alternative in Teradata SQL As mentioned earlier, Teradata does not support isnull function. There are many alternative methods that you can use as an alternative to isnull function. The SQL Server ISNULL() function…

Continue ReadingWhat is isnull Alternative in Teradata SQL?
Comments Off on What is isnull Alternative in Teradata SQL?

What is Dateadd Function Alternative in Teradata SQL?

In ANSI SQL, Dateadd function adds the specified value for the specified date or time part to a date, time, or timestamp. However, the same function is not available in Teradata. In this article, we will check what is Dateadd function alternative in Teradata SQL, methods and examples. Dateadd Function Alternative in Teradata SQL Many relational databases and data warehouse appliances such as Snowflake, SQL Server, Netezza, Oracle, etc support date add function to add or subtract days, months, years, hours, minutes, and seconds to date or timestamp value. For…

Continue ReadingWhat is Dateadd Function Alternative in Teradata SQL?
Comments Off on What is Dateadd Function Alternative in Teradata SQL?

How to Export Spark DataFrame to Teradata Table

In my other article, Steps to Connect Teradata Database from Spark, we have seen how to connect Teradata database from Spark using the JDBC driver. In this article, we will check how to export spark dataframe to a Teradata table using same JDBC drivers. We will also check how to create table our of Spark dataframe if it's not present in the target database. i.e. Teradata database. Export Spark DataFrame to Teradata Table Apache Spark is fast because of its in-memory computation. It is common practice to use Spark as…

Continue ReadingHow to Export Spark DataFrame to Teradata Table
Comments Off on How to Export Spark DataFrame to Teradata Table

Connect Teradata using Python pyodbc – Steps and example

Teradata is one of the widely used MPP databases. Teradata provides many connectors such as its own Python connector Teradata, Teradatasql, etc. You can use those to interact with the Teradata database. There are many different options to connect to Teradata. Teradata provides support for JDBC and ODBC drivers. In this article, we will check method on connect Teradata using the Python pyodbc module and odbc driver with a working example. Teradata ODBC Driver Being a popular MPP database, Teradata database server comes with ODBC support. Before attempting to connect…

Continue ReadingConnect Teradata using Python pyodbc – Steps and example
Comments Off on Connect Teradata using Python pyodbc – Steps and example

Teradata ROWNUM Pseudocolumn Alternative and Examples

The relational databases like Oracle supports the ROWNUM pseudo column. If you are from Oracle background, you may have used ROWNUM extensively to limit the output result set. But, There is no ROWNUM in Teradata. In this article, we will check Teradata ROWNUM pseudocolumn alternative with some examples. Teradata ROWNUM Pseudocolumn Alternative A ROWNUM is a pseudo column, which indicates the row number in a result set retrieved by a SQL query. It starts by assigning 1 to the first row and increments the ROWNUM value with each subsequent row returned. In the databases…

Continue ReadingTeradata ROWNUM Pseudocolumn Alternative and Examples
Comments Off on Teradata ROWNUM Pseudocolumn Alternative and Examples

Teradata Type Conversion Functions and Examples

Teradata is one of the common and widely used MPP database. Just like many relational databases, Teradata supports many useful functions. You can use these functions to covert the value of one data type to another. In this article, will check commonly used Teradata type conversion functions with some examples. The type conversion functions use common calling function i.e. the first argument is the value to be formatted or converted, and the second argument is a template that defines the output or input format. These conversion functions should be used…

Continue ReadingTeradata Type Conversion Functions and Examples
Comments Off on Teradata Type Conversion Functions and Examples

How to Check Integer Type Values in Teradata? Example

Data validation is one of the most important task in the data warehouse environment. Data validation includes, integer type check, count check, etc. For instance, check the row count after data migration. In my other article, we have discussed how to identify the decimal type values. In this article, we will see how to check integer type values in Teradata with some example. Integer type check can also be refereed as a integer data validation. Teradata Integer Type Values Check Just like many other relational databases, Teradata also provides many…

Continue ReadingHow to Check Integer Type Values in Teradata? Example
Comments Off on How to Check Integer Type Values in Teradata? Example