How to create DB2 Connections in While loop using shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to create DB2 Connections in While loop using shell script
# 1  
Old 04-08-2012
How to create DB2 Connections in While loop using shell script

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 INTO TABLENAME NONRECOVERABLE INDEXING MODE REBUILD ALLOW NO ACCESS;



done < $input_file

Please help me
If i give the connection above the while loop its not working
# 2  
Old 04-08-2012
Same as this post:
https://www.unix.com/shell-programmin...#post302620499

Double posting is frowned upon in this forum. If you find that you are not getting answers it is usually because you post is difficult to understand or contains insufficient or inconsistent information. In you case it is the latter.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

DB2 in awk or PARSING VALUE in Shell Script

Guys, My Motive is, There are some View names in the file with the format of SCHEMA.VIEWNAMe, I want to read the data from file and parse it to SCHEMA and VIEWNAME and execute DB2 command to get the base Table name. I can parse easily through AWK but i could not execute db2 commands in... (1 Reply)
Discussion started by: Nandy
1 Replies

2. Shell Programming and Scripting

Return db2 query value to shell script

Hi, Im new to DB2. I need to connect to DB2 from shell script and return the query output back to shell script variable. this is my code #!/bin/ksh db_name=db db_user=usr db_pwd=pwd db2 <<EOSQL connect to $db_name user $db_user using "$db_pwd" select count(1) from table quit EOSQL ... (3 Replies)
Discussion started by: sup
3 Replies

3. Shell Programming and Scripting

Using shell script to compare files and retrieve connections

Hello, I want to use shell script to generate network files (I tried with python but its taking too long). I have a list of nodes: node.txt LOC_Os11g37970 LOC_Os01g07760 LOC_Os03g19480 LOC_Os11g45740 LOC_Os06g08290 LOC_Os07g02800 I have an edge-list as well: edge.txt Source_node ... (2 Replies)
Discussion started by: Sanchari
2 Replies

4. UNIX for Dummies Questions & Answers

Shell script to collect inbound connections

Hi Kindly provide me shell script on server to collect inbound connections, using port number on Linux. (4 Replies)
Discussion started by: adminhelp
4 Replies

5. Shell Programming and Scripting

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. (1 Reply)
Discussion started by: kamalanaatha
1 Replies

6. Shell Programming and Scripting

connect to db2 using shell script

Guys, I am trying to write a shell script that connect to wcsprod database and read the query #!/bin/ksh sqlplus -s < connect to wcsprod user wcsadm using pwd > select * from catentry fetch first 1 row only with ur; databse: wcsprod user: wcsadm pwd: pwd thanks (1 Reply)
Discussion started by: skatpally
1 Replies

7. Shell Programming and Scripting

access db2 from shell script

How to connect to db2 through shell script using cygwin? (0 Replies)
Discussion started by: supriyat
0 Replies

8. Shell Programming and Scripting

How to call shell script from db2 triggger

Is there a way to call a shell script via db2 trigger? I want to wake up a shell script to perform some action if there is a insert action on a db2 table. (1 Reply)
Discussion started by: prasperl
1 Replies

9. Shell Programming and Scripting

How to connect DB2 table using shell script

Hi All, I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field. Could any one please help me in connecting database tables using Unix and retriving data from the same. Thanks, Durwas (0 Replies)
Discussion started by: dtidke
0 Replies

10. Shell Programming and Scripting

How to connect to database db2 through Unix Shell Script

I am trying to connect to database db2 through shell script. The process I am trying is > db2 It gives me error Access Denied. While checking for access I have the rights. Is there ant other way round..? Please help. (3 Replies)
Discussion started by: ankitgupta
3 Replies
Login or Register to Ask a Question