Hi everyone,
I have n number of data in my file "temp" in following order.In each line table_name and
column_name are different.input data is in same format each query in three lines.
ALTER TABLE table_name
ADD ( column_name1 VARCHAR2(10),
column_name2 VARCHAR2(70) );
ALTER TABLE table_name
ADD ( column_name1 VARCHAR2(10),
column_name2 VARCHAR2(70) );
ALTER TABLE table_name
ADD ( column_name1 VARCHAR2(10),
column_name2 VARCHAR2(70) );
I need to pick the table name from each line one by one and check that
this name exists in my another file "name" or not.
If the table name exists in the file "name" then i need to pick the column1_name,
column2_name..... and their data type which are after ADD.
In this way need to do above action to each data in file and stor them in a file
in the following format:
TABLE_NAME COLUMN_NAME DATATYPE
i have used the code
while read folder
folder=`awk '/ALTER/ { print $3; } ' data.txt`
do
cd $folder
echo "in" > test
cd ..
i=$[$i+1]
done < data.txt
but for this i m getting only one table_name with error.
can anybody help me with the script.I want my script in SH
Please help me with above asap.