Hello to all,
From a WEB Project at RBD 8.5 I try to execute a SQL statement using "prepare" (I want to build the SQL statement dynamic).
Although I have done the same thing successful with DB2 Connection, when I switch to SQL Server Connection, I receive the following error:
EGL0504E OPEN: SQL Server supports holdability at the connection level only. Use the connection.setHoldability() method.[sqlstate:00000][sqlcode:-99999]
EGL0501E GET NEXT: result set RESULTSET not found[sqlstate:24501][sqlcode:-501]
I tried to open the cursor "with hold" and I received for once again the same error.
The query function looks like:
function GetSpecRecs(SearchRec TechSupportRec[] out, WhereClause string in, SqlCode int out, SqlMsg string out) TechRec TechSupportRec; //single record for table searchRec = new TechSupportRec[0]; syslib.writeStdout("Step 1"); try prepare selectStatement from "SELECT ComCode, dwxpsymb, custcafm, onoma, custpatr, custdiey, custtawk, dwxpendt, dwxplhdt " + WhereClause; onException (exception SQLException); SqlCode = exception.sqlcode; syslib.writeStdout("Sql RExc0:"+exception.message); onException (exAny AnyException); syslib.writeStdout("any RExc0:"+exAny.message); end i int = 1; try //open the cursor open resultSet with selectStatement into TechRec.ComCode, TechRec.Policy, TechRec.AFM, TechRec.FLName, TechRec.FatherName, TechRec.Address, TechRec.PostalCode, TechRec.IncDate, TechRec.ExpDate; syslib.writeStdout("Step 2"); // Position into the list according to the listSpec.position passed to this function // This causes a read of the first element. onException (exception SQLException); SqlCode = exception.sqlcode; syslib.writeStdout("Sql RExc1:"+exception.message); onException (exAny AnyException); syslib.writeStdout("any RExc1:"+exAny.message); end try get next from resultSet ; onException (exception SQLException); SqlCode = exception.sqlcode; syslib.writeStdout("Sql RExc2:"+exception.message); onException (exAny AnyException); syslib.writeStdout("any RExc2:"+exAny.message); end // Get the rest while (sysvar.sqlData.sqlcode == 0) //then loop through the rest of the rows syslib.writeStdout("Step 3"); searchRec.appendElement(TechRec); // syslib.writeStdout("Rec1:"+AYRec.PolicyNo); try get next from resultSet; onException (exception SQLException); SqlCode = exception.sqlcode; syslib.writeStdout("Sql RExc3:"+exception.message); onException (exAny AnyException); syslib.writeStdout("any RExc3:"+exAny.message); end end syslib.commit(); end //of function
michaeldefox