@@ -0,0 +1,1863 @@
+/*%0A * AsTest.java%0A *%0A * Created on 10. September 2001, 09:44%0A */%0A%0Apackage freetds;%0Aimport java.sql.*;%0Aimport java.math.BigDecimal;%0Aimport com.internetcds.util.Logger;%0Aimport junit.framework.TestCase;%0Aimport junit.framework.TestSuite;%0Aimport junit.framework.AssertionFailedError;%0Aimport java.io.*;%0Aimport java.lang.reflect.*;%0A%0A/**%0A *%0A * @author  builder%0A * @version %0A */%0Apublic class AsTest extends DatabaseTestCase %7B%0A%0A  public AsTest(String name) %7B%0A    super(name);%0A  %7D%0A  %0A  public static void main(String args%5B%5D) %7B%0A    try %7B%0A      Logger.setActive(true);%0A    %7D%0A    catch (java.io.IOException ex) %7B%0A      throw new RuntimeException(%22Unexpected Exception %22 + ex + %22 occured in main%22);%0A    %7D%0A    if (args.length %3E 0) %7B%0A      junit.framework.TestSuite s = new TestSuite();%0A      for (int i = 0; i %3C args.length; i++) %7B%0A        s.addTest(new AsTest(args%5Bi%5D));%0A      %7D%0A      junit.textui.TestRunner.run(s);%0A    %7D%0A    else%0A      junit.textui.TestRunner.run(AsTest.class);%0A  %7D%0A  %0A  public void testProc1() throws Exception%0A  %7B%0A%0A    boolean passed = false;%0A    Statement stmt = con.createStatement();%0A    stmt.executeUpdate(%22  if (exists (select * from sysobjects where name = 'spTestExec')) drop procedure spTestExec%22);%0A    stmt.executeUpdate(%22  if (exists (select * from sysobjects where name = 'spTestExec2')) drop procedure spTestExec2%22);%0A%0A    stmt.executeUpdate(%22 create procedure spTestExec2 as %22 +%0A                    %22select 'Did it work?' as Result%22);%0A    stmt.executeUpdate(%22create procedure spTestExec as %22 +%0A%09%09%22create table #tmp ( Result varchar(50) ) %22 + %0A%09%09%22insert #tmp execute spTestExec2 %22 +%0A%09%09%22select * from #tmp%22);%0A    CallableStatement cstmt = con.prepareCall(%22exec spTestExec%22);%0A    ResultSet rs = cstmt.executeQuery();%0A    while (rs.next()) %7B%0A      passed = true;%0A    %7D%0A    assertTrue(passed);%0A    // stmt.executeQuery(%22execute spTestExec%22);%0A%0A  %7D%0A%0A%7D%0A

Test PMoores Problem with Procedure sptestexec