HOW TO PREPARE A LOAD STATEMENT
Posted in 1995
Dilip,
As mentioned here the LOAD and UNLOAD statements are NOT prepareable
A few interesting suggestions though. Here is one more that MAY help
Use a shell script and pass in the file names as a parameter
{Code segment begins}
#!/bin/sh
###################################
## Get the table names into a file
###################################
isql -s dbname <<!
unload to mytabs
select tabname
from systables
where tbaname[1,3] != 'sys'!
#####################################
## Unload each of these files in turn
#####################################
for i in `cat mytabs`
do
isql -s dbname <<!
unload to $i
select *
from $i!
done
###################################
## Load each of these files in turn
###################################
for i in `cat mytabs`
do
isql -s dbname <<!
load from $iinsert into $i
!
done
{code segment ends}
Have fun
================================================================
Terry Boyland :^{})
Proverb: Once a king always a king But once a knight is enough !