I want to know how it can be achieve I have a file A.sql. A.sql has insert command with WHERE clause and update command with WHERE clause.
SQL file:
INSERT INTO Table1 SELECT columns FROM table2 WHERE col1 BETWEEN 'Value1' AND 'Value2'
UPDATE table1 SET (coluname) = (SELECT colname FROM table2 WHERE some_col = 'Value3')
WHERE EXISTS(SELECT 1 FROM table2 WHERE some_col ='Value3')
User define Value1, Value2, Value3 while running batch file.
Batch file:
SET PRO=A.sql
sqlplus %Cond%@%HOMEDIR%sql/%PRO% >>%HOMEDIR%log/%log_file%