10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team,
below sql rerturn 20 records, the result set i am going to assign to one variable and it showing count is 1.
and i don't use count() in sql query... based on count, i need to fail the script.
No_of_step=`echo ${g_count} | wc -l`
function gf_count()
{
g_count=`sqlplus -s... (8 Replies)
Discussion started by: bmk123
8 Replies
2. Shell Programming and Scripting
Hi
iam new to shell scripting
how to declare variables as redshift query and I have to compare two counts by using if condition .
ex:count=select count(*) from prd;
select count(*) from prd;
select count(*) from tag;
can any one help me .
Please use CODE tags when displaying... (1 Reply)
Discussion started by: sam526
1 Replies
3. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
4. Solaris
Hi
I am trying to run sql query from solaris in csh script and send the output to email. Below is my sql query
select p.spid,se.program seprogram, se.machine, se.username, sq.sql_text,sq.retrows from v$process p
inner join v$session se on p.addr = se.paddr
inner join
( select... (2 Replies)
Discussion started by: tharmendran
2 Replies
5. Shell Programming and Scripting
Hi ,
I have a query like
select err_qty,drop_qty,unbld_qty,orig_qty from usage_data;
I need to store the values of these fetched fields in variables,
Need to edit them and update the new values into the table.
Can anyone please help me in writing this piece of code:( (1 Reply)
Discussion started by: Rajesh Putnala
1 Replies
6. Shell Programming and Scripting
Hi
I want ot save SQL query result in one txt file. for that i have written one code line
sqlplus -s $dbstring @/usr/local/bin/sched/nightly_Cronjob/exec_123.sql >> /usr/local/bin/sched/nightly_Cronjob/result.txt
but it is not working .
database : Oracle
so please advice me how can i... (7 Replies)
Discussion started by: Himanshu_soni
7 Replies
7. Shell Programming and Scripting
I would like to use the result of a query in another query. How do I redirect/add the output to another variable?
$result = odbc_exec($connect, $query);
while ($row = odbc_fetch_array($result)) {
echo $row,"\n";
}
odbc_close($connect);
?>
This will output hostnames:
host1... (0 Replies)
Discussion started by: hazno
0 Replies
8. Shell Programming and Scripting
I created a script to read a csv file with four columns. The script also saved values of each col in a arry.
In the script, i connected to db try to run a query to pull out data baisc on the values from the csv file.
select Num from tableName
where Sec_Num in ('${isin}') /*isin is an arry... (1 Reply)
Discussion started by: Sherry_Run
1 Replies
9. Shell Programming and Scripting
:)
Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable.
like
#!/bin/ksh
v_shell_var=Hi
here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array).
Regards,
Div (4 Replies)
Discussion started by: div_Neev
4 Replies
10. Shell Programming and Scripting
I know htis isnt exactly unix.... but hopefully someone can help me or direct me someplace to get help.
I can run sql queries in scripts against my informix db using:
dbaccess mydb myquery.sql >> sql.output
I need to write my script to select based on todays date. Its very... (5 Replies)
Discussion started by: MizzGail
5 Replies