07-11-2011
How to pass tablenames from a file to shell script to execute create statement in DB2
Hi,
I am new to Shell Scripting, and I need to create nicknames for 600 tables in db2. I have the file names in a text file and i have to pass these table names to a shell script create nicknames in db2. Can some one please help me in this regard.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all, I have a shell script which invoke a sql script using command
db2 -tf /home/me/db_housekeep.sql -z /home/me/db_housekeep.log
however, this mentioned sql script requires several input arguments, I wonder if one can pass variables from shell script to sql script? thanks! (0 Replies)
Discussion started by: mpang_
0 Replies
2. Shell Programming and Scripting
I need to pass a variable as a parameter from shell script into a DB2 database.
var=bhuk_1123_Q_11/22/09
select * from tbl1 where serial_id='$var';
I have tried executing it using
db2 -tvf scriptname
Somebody please help me out with this. It is throwing an error. Please tell me how... (2 Replies)
Discussion started by: ss3944
2 Replies
3. Shell Programming and Scripting
I need to pass a DDL statement into a ksh script & parse the statement.
What is the best way to pass a DDL statement into a KSH script.
---------- Post updated at 09:28 AM ---------- Previous update was at 07:35 AM ----------
if the name of the script is test.ksh
test.ksh "ALTER TABLE... (12 Replies)
Discussion started by: gayathree
12 Replies
4. Shell Programming and Scripting
Hi ,
I Have following requirement:
DB2 Sql query to pass from a parameter file
for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt
How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies
5. Shell Programming and Scripting
load_cursor_stmt()
{
ls /db/admin/ddl/rmn01000/load_cursor*.sql|while read file
do
echo "${file}"
`nohup db2 -tvf "$file" \&`
done
}Error:
-------
/admin/ddl/rmn01000/load_cursor5.sql /db/admin/ddl/rmn01000/load_cursor6.sql
+ read file
+ echo... (3 Replies)
Discussion started by: Hangman2
3 Replies
6. Shell Programming and Scripting
Hi ,
I have to create a db2 connection for the while loop in shell scripting.
Below is the connection for DB2 I have to establish
connect to TABLESCHENMA user $USERID using $PASSWORD
Below is the while loop.
while read TABLE; do
db2 LOAD CLIENT FROM
$DIRECTORY/$TABLE.ixf OF ixf INSERT... (1 Reply)
Discussion started by: vikyalex4
1 Replies
7. Shell Programming and Scripting
I'm in the process of writng a function that consists of a case statement is there a way of calling the function and passing a value to it?
ie
function1 () {
case
opt1 do .....
opt2 do.....
esac
}
function opt1
I'm aware the syntax is not correct, but you get the general idea. (1 Reply)
Discussion started by: squrcles
1 Replies
8. Shell Programming and Scripting
Hi All,
I am new to shell script. I am trying to pass value from .sh file to .sql file .
But I am able to run the .sql file from .sh file with values in sql file.
But I am unable to pass the values from .sh file. can some one please help to resolve this.
here is my .sh file
s1.sh
... (4 Replies)
Discussion started by: reddy298599
4 Replies
9. Shell Programming and Scripting
Table TAB1 contains following example data (its a tree sitting in table data format & its driven based CHILD & PARENT column pick the RULE condition to generate the below SQL:
CHILD PARENT SS MID MNM VNM RULE FLG
1 ? S1 ? ? V1 rule004 I
2 1 S1 ? ? V1 0 Z
3 1 S1 ? ? V1 1 Z ... (6 Replies)
Discussion started by: gksenthilkumar
6 Replies
10. Shell Programming and Scripting
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies