tsql scripts generate an error with JDBC if conditional statements present
Posted on 2004-08-23
I'm trying to execute the following code
PreparedStatement ps = con.prepareStatement(sqlBlock);
done = ps.execute();
where done is of type boolean and sqlBlock contains the tsql script. As long as the tsql script contains only set/select/declare statements, done returns true.
But when the tsql script has any if/while/create/print statements, done is false and there's no resultset returned even if there are select statements in the script.