Use IF else statement

Dell Inspiron 11z notebook- customizable
November 20, 2009 at 13:02:58
Specs: Windows XP, 1 gb
Hey guys

I m back with another challenge...

I want to use if else statement using batch file. Here is my condition for If statement is that I Want to get count from one of our Oracle data base and if count is > 30 then set variable = 0 else set variable = 1

Appreciate your help guys..

See More: Use IF else statement

Report •

November 20, 2009 at 14:04:24
if %count% lss 31 (
set /a myvar=1
) else (
set /a myvar=0)

Report •

November 20, 2009 at 14:16:39
hey nbrane

thanks for your reply..

Here my problem is how to get count from table..

I mean how to write SELECT SQL Query using batch file..

Report •

November 23, 2009 at 03:49:21
you have to use something like 'osql' or 'sqlcmd' to perform the SELECT statement against the SQL database.

should be something like:
osql -S <servername/ip> -U <username> -P <password> -Q "SELECT COUNT(*) FROM <databasename>..<tablename>

... followed but whatever conditions of the query you want.

Report •

Related Solutions

November 23, 2009 at 19:21:15
hey thanks a lot

Report •

Ask Question