Values passing out of isql session


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Values passing out of isql session
# 1  
Old 06-09-2013
Values passing out of isql session

hi ..

i have a isql session which inside which i have two variables defined.. i wanna calculate % based on those variables. i knw i can easily do % calculation in csh if i could get the value of these variables passed outside the isql session . is tat possible ?? pls advice

somthin like below :

Code:
isql -S -U -P <EOF>

declare @a int
declare @b int
select @a=count(*) from table a
select @b=count(*) from table b
go

EOF

i want these value of @a and @b outside the isql session.. is that possible ?
# 2  
Old 06-11-2013
Why not calculate in SQL? Does csh have arithmetic, I have been warned to never learn it more than I have to. You could write the problem into bc. Watch out for divide by zero.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert bulk values in DB table using isql

Hello, Objective is to insert bulk values in DB table using isql. Following code tried: isql -SServer_name -Ddb_name -Uuser_name -Ppassword < file.txt cat file.txt for i in `cat data_value_file.txt` do insert into tempdb..temp_table11 values ('$i') go done cat... (3 Replies)
Discussion started by: manishdivs
3 Replies

2. Web Development

Passing values in PHP using POST

Lets say that I have a URL that consists of: myserver/something1.php My second URL is myserver/something2.php I have a variable called $var inside something1.php and once I submit the website the $var changes. Now when I do this I want to send this value using POST to something2.php and echo... (1 Reply)
Discussion started by: puttster
1 Replies

3. Shell Programming and Scripting

passing keycodes to a unix session

Hi - i have an unix application which receives user input and prints certain details. the problem is i am trying to automate it and i don't know how to pass a list of commands to the application using shell script. here documents don't work as well - if i use the here document when i am opening... (3 Replies)
Discussion started by: azzazin007
3 Replies

4. Web Development

Help with passing HTML values in to JavaScript

Not sure if this is the right place to ask this but here goes. I am creating a cheat sheet for co-workers. The concept is that you pick wire size and conduit size and the amount of wires that will fit is displayed. I haven't used alot of drop downs and can't quite figure out the way the get id... (3 Replies)
Discussion started by: zero3ree
3 Replies

5. Shell Programming and Scripting

passing database password to isql command in shell script

Hi, I need to connect to DB through my shell script. but I dont want to hardcode my db password in the script. Is there a way to do it? Thanks ---------- Post updated at 07:42 PM ---------- Previous update was at 04:54 PM ---------- :(Guys..please help me with this:( (1 Reply)
Discussion started by: agrawal.prachi
1 Replies

6. Shell Programming and Scripting

Passing Shell Variables in ISQL

Hi.. I am passing a variable in my shell function. I need to access it for an isql comand in the shell script. However the isql o/p gives no results if i pass a variable in the command. The isql command works perfectly fine if i hardcore the table name. My script is : ... (0 Replies)
Discussion started by: dikki
0 Replies

7. Shell Programming and Scripting

get values from isql query

hi all i have an isql sentence in a ksh script, what get some values from my database (Sybase IQ 12.5 - solaris 5.7) how can i read this sql results??? do i have to do a while?? a for??? where do i put the values?? my idea is put them in an array, is that possible? please, help me... (3 Replies)
Discussion started by: DebianJ
3 Replies

8. Shell Programming and Scripting

passing values into logrotate??

Wondering if this is possible? OK, here is my question. I'm backing up a TON of different logs in different locations. I'm querying a database for the information. What I'd like to do, is pass that information into a logrotate script for the backup.. i.e. I'm trying to do the following: ... (1 Reply)
Discussion started by: imbiea
1 Replies

9. Shell Programming and Scripting

Passing Values from a shell script

Hi all I want to know how to pass value from one shell script to another suppose i have script named A.This 'A.sh' calls 'B.sh' .Now some calculations are done by B.sh ..Say in variable X. Now i want to pass the value of this X variable to 'A.sh'... A.sh ----> B.sh ( X variable ) ... (6 Replies)
Discussion started by: dhananjaysk
6 Replies

10. Shell Programming and Scripting

Passing values out awk.

found that passing (input) values to awk, all work well. For example: errpt | awk 'BEGIN { errore=0 } substr($2,1,4) /'ParamData'/ { .... } ' ParamData=`date +"%m%d"` Now I wish to obtain (output) a value. Using this method is it possible to re-write ParamData, for example? Thanks in... (3 Replies)
Discussion started by: gio123bg
3 Replies
Login or Register to Ask a Question