[Resolved]
Hello,
(sorry if my english is not exact i'm not english)
I'm using a "test" database and a "working" database
I would like to know how much results i have in my table "incident" in each database to compare
I'm using SQLplus in a .bat file
I resolved the problem writing in only 1 text file (but you can do it with 2)
Write in resultat.txt the result of the query on the working database :
echo SELECT count(*) FROM table; | sqlplus -s user/password@dbprod > path\resultat.txt
Set in the variable return1 (i think the last line of) the content of resultat.txt :
for /f "tokens=*" %%i in (path\resultat.txt) do set return1=%%i
Same commands with the test
echo SELECT count(*) FROM table; | sqlplus -s user/password@dbtest > path\resultat.txt
for /f "tokens=*" %%i in (path\resultat.txt) do set return1=%%i
Here i overwrite the resultat.txt file but you can write in another text file
And now you can display and test the equality :
echo resultat prod : %return1%
echo resultat test : %return2%
if %return1%==%return2% (
echo IMPORT REUSSI
) else (
ECHO IMPORT RATE
)
pause