Hello World

Teradata Developer Guides

ft:locale
en-US
ft:lastEdition
2026-08-18

Let's start with something simple. What if we wanted the database to print "Hello World"?

SELECT *
FROM
  SCRIPT(
    SCRIPT_COMMAND('echo Hello World!')
    RETURNS ('Message varchar(512)'));

Here is what we've got:

Message
------------
Hello World!
Hello World!
Hello World!
Hello World!

Let's analyze what just happened here. The SQL includes echo Hello World!, which is a Bash command. The script runs once on each AMP, so the number of returned rows depends on the number of AMPs in your Teradata system.

-- Teradata magic that returns the number of AMPs in a system
SELECT hashamp()+1 AS number_of_amps;

Returns:

number_of_amps
--------------
             4

This simple script demonstrates the idea behind the Script Table Operator (STO). You provide your script and the database runs it in parallel, once for each AMP. This is an attractive model in case you have transformation logic in a script and a lot of data to process. Normally, you would need to build concurrency into your application. By letting STO do it, you let Teradata select the right concurrency level for your data.