What's the Teradata programming language?

General
Enthusiast

What's the Teradata programming language?

Hi,

I will need to do some programming in Teradata and has looked around on the net where people have said BTEQ is the most suitable.

I have experience with VBA and want to write Loops etc, so is BTEQ the one?

If anyone has any links to some good tutorials, I would appreciate it too.

Thank you.Smiley Very Happy


Accepted Solutions
Teradata Employee

Re: What's the Teradata programming language?

Hi OscarBoots,

 

BTEQ is the command line connection tool to connect to Teradata (like SQL*Plus for Oracle DB, psql for postgresql and so on).

Teradata implements stored procedure, you can check the documentation :

https://docs.teradata.com/reader/aFcrqJBUrrMhnpBHTtr71g/8HKINIJunvVnILbt4M1mUw

 

Stored procedures are called Persistent Stored Modules in the ANSI/ISO SQL:2008 standard. They are written in SQL and consist of a set of control and condition handling statements that make SQL a computationally complete programming language.

These features provide a server-based procedural interface to Teradata Database for application programmers.

Teradata stored procedure facilities are a subset of and conform to the ANSI/ISO SQL:2008 standards for semantics.


 

1 ACCEPTED SOLUTION
10 REPLIES 10
Enthusiast

Re: What's the Teradata programming language?

To add more detail, I found on the net that Oracle has PL/SQL, etc etc... & Teradata has BTEQ.

I wanted to see if anyone had any opinions and if true some tutes.

Thanks 

Teradata Employee

Re: What's the Teradata programming language?

Hi OscarBoots,

 

BTEQ is the command line connection tool to connect to Teradata (like SQL*Plus for Oracle DB, psql for postgresql and so on).

Teradata implements stored procedure, you can check the documentation :

https://docs.teradata.com/reader/aFcrqJBUrrMhnpBHTtr71g/8HKINIJunvVnILbt4M1mUw

 

Stored procedures are called Persistent Stored Modules in the ANSI/ISO SQL:2008 standard. They are written in SQL and consist of a set of control and condition handling statements that make SQL a computationally complete programming language.

These features provide a server-based procedural interface to Teradata Database for application programmers.

Teradata stored procedure facilities are a subset of and conform to the ANSI/ISO SQL:2008 standards for semantics.


 

Ambassador

Re: What's the Teradata programming language?

Hi,

 

The only 'language' that the Teradata database understands is SQL (yeah, I know you could add the 'Monitor' commands but we'll ignore those for now).

 

How you send those SQL commands to the dbms is where your programming comes in.

- You could use an existing tool (provided by Teradata themselves or another company). Common tools include Bteq, SQLA, TD Studio.

- You can write your own program to issue SQL commands. Take your pick from VB, VBA, C, C#, Java, Perl (I think)...

- When writing your own program you also have to decide which API you're going to be using, ODBC, CLIv2 (Teradata's own), JDBC, NET DP...

 

You talk about Bteq. This is essentially a tool that reads a text file full of sql commands and sends them to the dbms. It has some rudimentary loop capability. Look in the manual.

 

Start with that and see where you get to.

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Enthusiast

Re: What's the Teradata programming language?

Thanks Waldar,

I thought Stored Procedures would be the place to code until I saw that article about BTEQ.

Cheers P

Enthusiast

Re: What's the Teradata programming language?

Thanks DaveWellman,

I think the best way would be to use a Stored Procedure.

Any links to useful Stored Procs Loops etc would be good if you know of any?

Thanks P

 

Teradata Employee

Re: What's the Teradata programming language?

Basically something like :

    l$_fc: -- naming the cursor
    for cur_col as colcur cursor for
    (
          select something from somewhere order by column
    )
    do
        sql command;               -- you can execute SQL
set variable = variable+1; -- you can do stuff with your variables call command; -- you can call another SP end for l$_fc;
Highlighted
Ambassador

Re: What's the Teradata programming language?


Any links to useful Stored Procs Loops etc would be good if you know of any?

 


Btw, if you want to process data (not metadata) you should try to avoids loops (& even worse cursors) as much as possible.

Junior Supporter

Re: What's the Teradata programming language?

As mentioned by others, you can connect to Teradata in many ways and do some programming. Specifically for VBA as you mentioned, you can do that as well. I have an application where i use VBA to connect to TD, it wroks perfectly.

--Samir

Enthusiast

Re: What's the Teradata programming language?

Thanks dnoeth,

I might start another post because I have some other questions and I've closed this post.

Pete