Create a list based on a db2 list of tables




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.
.



Relevant Pages

  • Stored procedure failing on nightly cycle only
    ... I have a series of stored procedures in db2 on ... an AS400 which are executed from a SQL Server Job, ... put on a trace of activity on the AS400 which yielded a 100,000 page ...
    (comp.sys.ibm.as400.misc)
  • Error: DTSrun vs DTSrunUI
    ... I have a very simple DTS job that takes one parameter ... Everything works great when I use DTSrunUI to execute ... I can even grab the command line syntax using ... does not exist on the DB2 table. ...
    (microsoft.public.sqlserver.dts)