Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Prob Assign Row count to a variable

Original Message
Name: iam2001
Date: July 11, 2007 at 12:57:46 Pacific
Subject: Prob Assign Row count to a variable
OS: Unix
CPU/Ram: N/A
Model/Manufacturer: N/A
Comment:
Is it possible to use a shell script to login to a database (using Teradata), run a query and assign the query result to a local variable defined in the shell?
I know it's possible to run teradata SQL through a shell script if teradata is installed on the machine but what I want to do is to assign a value to a variable while at the SQL prompt.

Thanks!


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: July 11, 2007 at 14:33:37 Pacific
Subject: Prob Assign Row count to a variable
Reply: (edit)
Using command substituition, it's possible to assign the contents of any valid unix command - including shell scripts - to a shell variable. Using the Bourne shell, it's

# that's the back tic
a=`echo 1`

or if you are using korn or bash type shells:

b=$(echo 2)



Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Prob Assign Row count to a variable

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12

help mandriva install last straw!

Icon Scaling in Explorer Bar


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC