Create a list based on a db2 list of tables
- From: Justin <soundguy321@xxxxxxxxx>
- Date: Fri, 1 Jun 2012 08:01:53 -0700 (PDT)
What is the best way to grap a list of tables and loop through to
execute a statement. Here is my beginning thoughts behind the code:
#!/bin/bash
db2 connect to $1
# get list of all tables for a specific db
TABLES=$db2 list tables | cut -b 1-32
for t in $TABLES
do
db2 "grant select,insert,update,delete on $FILE to user userid"
done
The issue is properly loading the TABLES variable with a list of
tables.
.
- Follow-Ups:
- Re: Create a list based on a db2 list of tables
- From: Chris F.A. Johnson
- Re: Create a list based on a db2 list of tables
- Prev by Date: Re: What is needed to make a DVD (from VHS) do trick play?
- Next by Date: Re: Monitors
- Previous by thread: Re: What is needed to make a DVD (from VHS) do trick play?
- Next by thread: Re: Create a list based on a db2 list of tables
- Index(es):
Relevant Pages
|