10 More Discussions You Might Find Interesting
1. 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
2. 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
3. Shell Programming and Scripting
I have a sql statement , i need to assign to a variable in Unix
sel count(*) AS num_files from TABLE_A;
i need to use "num_files" in unix statements. let me know how to assign unix variable to above num_files (1 Reply)
Discussion started by: nani1984
1 Replies
4. Shell Programming and Scripting
Hi,
I have a requirement to store oracle sqlplus output to some unix variable, count the records and then print the output on the screen.
Can you please point me to any sample program for reference purpose.
Thanks a lot for your time. (0 Replies)
Discussion started by: bhupinder08
0 Replies
5. Shell Programming and Scripting
I am trying to assgn the output of the select statement to a variable, like this
"VARIABLE_NAME=$ db2 "select COLUMN_NAME_1 from TABLE_NAME where COLUMN_NAME_2='VALUE_TO_CHECK'"; "
but the value that is getting into VARIABLE_NAME is
"COLUMN_NAME_1
-----------------
VALUE
1... (3 Replies)
Discussion started by: sgmini
3 Replies
6. Shell Programming and Scripting
i have to do a check in my UNIX script to see whats saved in the database. depending on whats there will fork data to certain functions. However i do not know how to capture SQL output into a UNIX variable.
Below is what i have tried, but i get an error:
Error 3706 Failure 3706 Syntax error:... (3 Replies)
Discussion started by: purplebirky
3 Replies
7. Shell Programming and Scripting
I have this shell script where I have both pl/sql and sql.
But want to have a snigle output file where the result of each cursors are in HTML tables.
I was able to do that on my old script but it was only sql scripts (no pl/sql).
Can I do have such outputs now with my new script where I... (2 Replies)
Discussion started by: arobert
2 Replies
8. Shell Programming and Scripting
Hi,
My requirement is :
We are calling an sql statement from a UNIX session, and fetching data into some variables from a table .. now we are unable to access these variables from outside the SQL part. Please let me know how can I achieve this.
Can you please share a code snippet which... (4 Replies)
Discussion started by: venkatesh_sasi
4 Replies
9. Shell Programming and Scripting
Hi all
I would like to open a SQL session from within a shell script and then redirect the output of the SQL command to a file.
e.g.
#!/bin/bash
sqlplus "/ as sysdba" <<EOF
@$HOME/recovery_space.sql
EOF
I want to redirect the output of the SQL command to a temp file, because... (2 Replies)
Discussion started by: soliberus
2 Replies
10. Shell Programming and Scripting
Hi Guys !
I am new to unix and want to find out how we can make sql statement data to shell script variable?
Any help/suggestion is greatly appreciated
-Chandra (1 Reply)
Discussion started by: kattics
1 Replies