The following script will generate the file that you would then run at the command line......
$>dbaccess <database> grant.sql
SCRIPT STARTS HERE.......
#!/bin/ksh
if [ $# -lt 3 ]
then
echo "Usage : permissions <select|insert|update|delete|all> <username> <database_name> "
exit
else
> grant.sql
for i in $3
do
#echo "select 'grant $1 on '||tabname[1,18]||' to $2 as '||owner[1,8]||';' from systables where tabid > 99 and tabtype = 'T' " |dbaccess $3 |sed -e 1,4d>
> grant.sql
echo "select 'grant $1 on '||tabname[1,18]||' to $2 as '||owner[1,8]||';' from systables where tabid > 99 " |dbaccess $3 |sed -e 1,4d>> grant.sql
done
fi
END OF SCRIPT.
You need to run this script as user "informix".
-Abraham