Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Return value from MSSQL stored procedure (Using SQL.callStoredProcedure)
Return value from MSSQL stored procedure [message #1843494] Mon, 02 August 2021 12:21 Go to next message
Mr Robot is currently offline Mr RobotFriend
Messages: 70
Registered: March 2020
Member
Hi,

what is proper way to call stored procedure using SQL.callStoredProcedure method.

Using CallableStatement I am able to get return parameter from MSSQL stored procedure but using SQL Scout wrapper class cannot.

I have sample SP called "testproc" with two params, one set as output.

I tried:
IntegerHolder holder = new IntegerHolder();
SQL.callStoredProcedure("testproc @in_par=:inPar, @out_par=:outPar INTO :holder", new NVPair("inPar", 1), new NVPair("outPar", 2), new NVPair("holder", holder));

This is executed, two IN params are registers and one OUT is registered. This is output:
SQL with binds:
*** UNPARSED ***
TESTPROC @IN_PAR = :inPar , @OUT_PAR = :outPar INTO :holder
IN  :inPar => ? [INTEGER 1]
IN  :outPar => ? [INTEGER 2]
OUT :holder => ? [Integer] 
null

Holder value is always null.

I am using Scout v.11.0.24, running on Windows 10 64bit and latest Eclipse.
and using MSSQL JDBC:
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>7.2.1.jre8</version>
</dependency>
Re: Return value from MSSQL stored procedure [message #1843524 is a reply to message #1843494] Wed, 04 August 2021 08:04 Go to previous message
Mr Robot is currently offline Mr RobotFriend
Messages: 70
Registered: March 2020
Member
This is syntax:

IntegerHolder holder = new IntegerHolder();
SQL.callStoredProcedure("testproc @in_par=:inPar, @out_par =:[OUT]returnValue", new NVPair("inPar", 1),  new NVPair("returnValue", holder));
Previous Topic:Session on idle is null, no message box
Next Topic:Widget FileChooserField. Scout 11
Goto Forum:
  


Current Time: Fri Apr 19 12:38:24 GMT 2024

Powered by FUDForum. Page generated in 0.02048 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top