Connection with Teradata through shell Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connection with Teradata through shell Script
# 1  
Old 07-07-2015
Connection with Teradata through shell Script

Hi All,

As we are using SQLPLUS command to connect Oracle Database in unix:
Like below syntax:

Code:
 
sqlplus username/password@dbname << EOI
 SET HEADING OFF
 SPOOL MAX_DATE_VAL.txt
 select max(LAST_UPDT_DATE) from source_defect;
 SPOOL OFF

here the result is stored in a file named MAX_DATE_VAL.txt.

How can we do the same with Teradata?

Need to store the Teradata query result in a file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help! Shell Script for Wifi Connection

Hi, I am quite new to shell scripting and was wondering if it was possible to automatically enter the username and password fields to a wifi-access-router and then ping it. I have most trouble with entering the username and password fields. Is that even possible? Also, what do I do if the... (1 Reply)
Discussion started by: Xyn
1 Replies

2. Shell Programming and Scripting

How to Connect to Teradata and Run in Shell Script?

Hi Master, I need to create dan run script in linux to get data from teradata I did this ---------- Post updated at 02:28 AM ---------- Previous update was at 02:25 AM ---------- LOG_DIR="/home/"; OUTDIR="/home/"; SCRIPT_NAME=“test"; DUMPFILE="${OUTDIR}${SCRIPT_NAME}"_"$(date... (2 Replies)
Discussion started by: radius
2 Replies

3. Shell Programming and Scripting

Sybase connection failing through shell script

Hi All, I'm trying to connect to Sybase via shell script. i'm getting the following error. Please let me know where i'm going wrong. Note that i'm not having this issue when connecting via terminal. #!/usr/bin/bash SYBASE=/usr/sybase ISQL=$SYBASE/bin/isql export SYBASE ISQL ... (6 Replies)
Discussion started by: Irishboy24
6 Replies

4. Shell Programming and Scripting

Verifying oracle connection from shell script

Hi, Oracle 9.2 Solaris 10 From the shell script ........How can we verify whether oracle connection is successful or not ? Shell script will prompt the user to enter the oracle schema username, password and tns name. So, *how to verify whether oracle connection has been established or... (14 Replies)
Discussion started by: milink
14 Replies

5. Shell Programming and Scripting

SFTP connection using shell script

Hi , I am able to manually connect to remote system usning "sftp" protocol. But when I using the below command in the script but I am not able to connect. `sftp TEST01@120.34.3.4` And the connection should not be closed after login. Please help to solve this. Thanks Satya (2 Replies)
Discussion started by: Satyak
2 Replies

6. Shell Programming and Scripting

oracle connection from shell script

Hi, For connecting to oracle my script is using the command sqlplus username/password@db_instance_name.For this to work i am setting ORACLE_HOME,TNS_ADMIN and ORACLE_SID in a seperate script.My question is,could we make a connection to oracle just by the command sqlplus... (4 Replies)
Discussion started by: DILEEP410
4 Replies

7. UNIX for Dummies Questions & Answers

sybase connection through shell-script

:mad: how do i connect to sybase through shell script written in linux (9 Replies)
Discussion started by: Amitabh
9 Replies

8. Shell Programming and Scripting

Connection to database through shell script

Hi when i am calling the shell script with two parameter like id and date it works fine.But the same shell script is call by java application it gives the error as shown below Thu Jan 8 04:13:22 EST 2009|The Get Segment Process Failed: SP2-0306: Invalid option. Usage: CONN where <logon>... (1 Reply)
Discussion started by: ravi214u
1 Replies

9. Shell Programming and Scripting

Shell/perl script to connect to different servers in single login in teradata

Hi, I want to write a shell script to compare two tables in teradata.these tables are present on different servers. I want to connect to both servers in single login in order to fetch and compare the data in one go. Thanks (1 Reply)
Discussion started by: monika
1 Replies

10. Shell Programming and Scripting

Script that can access any type of(Teradata,Oracle) database

Hi, I need to create a script that can execute database independent queries. Database can be of any type whether tearadata,Mysql,oracle,DB2. Does anyone have any idea how to implement this. (3 Replies)
Discussion started by: monika
3 Replies
Login or Register to Ask a Question
MONGO(1)							  Mongo Database							  MONGO(1)

NAME
mongo - the Mongo command-line tool SYNOPSIS
mongo [OPTIONS] [DB_ADDRESS] [FILE+] DESCRIPTION
mongo is a JavaScript shell (with GNU readline capabilities). It supports interactive and non-interactive use. When used interactively, JavaScript can be used to query the database or perform any other function normally available with SpiderMonkey. Database output is dis- played in JSON format. If JavaScript files are specified on the command line, the shell will run non-interactively, running each one in sequence and then exiting. EXAMPLES
mongo start the shell, connecting to the server at localhost:27017 and using the test database mongo foo start the shell using the foo database at localhost:27017 mongo 192.169.0.5/foo start the shell using the foo database at 192.169.0.5:27017 mongo 192.169.0.5:9999/foo start the shell using the foo database at 192.169.0.5:9999 mongo script1.js script2.js script3.js run three scripts and exit OPTIONS
--shell run the shell after executing files --help show usage information --host HOST server to connect to (default HOST=localhost) --port PORT port to connect to (default PORT=27017) --nodb do not connect to mongod --eval SCRIPT evaluate JavaScript -u USERNAME specify user to log in as -pPASSWORD specify password of user (notice there is no space) COPYRIGHT
Copyright 2007-2009 10gen SEE ALSO
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org. AUTHOR
Kristina Chodorow 10gen June 2009 MONGO(1)