Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OUT parameter don't work for MSSQL #19

Open
GoogleCodeExporter opened this issue Sep 2, 2015 · 4 comments
Open

OUT parameter don't work for MSSQL #19

GoogleCodeExporter opened this issue Sep 2, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

MSSQL columnType  for OUT is 2

jdbc-proc  check with constant  OUT=4


Original issue reported on code.google.com by [email protected] on 29 Mar 2012 at 11:36

@GoogleCodeExporter
Copy link
Author

See 
http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.sql.DatabaseM
etaData.procedureColumnUnknown

According the doc there are constants for column types in procedures:

public static final int procedureColumnIn   1
public static final int procedureColumnInOut    2
public static final int procedureColumnOut  4
public static final int procedureColumnResult   3
public static final int procedureColumnReturn   5
public static final int procedureColumnUnknown  0

Jdbc-proc does not support IN_OUT parameter to be clearly.

May be you use IN_OUT parameter in the procedure?

Original comment by [email protected] on 4 Apr 2012 at 10:38

@GoogleCodeExporter
Copy link
Author

hmm, i think for mssql stored proc this parameters always as IN_OUT

example sored proc:

CREATE PROCEDURE GetImmediateManager
   @employeeID INT,
   @managerID  INT OUTPUT
AS
BEGIN
   SELECT @employeeID ,@managerID

   set @managerID=1
END


first you can call this SP with two params 

exec GetImmediateManager 1,2

result:

1 2

second we can call this SP with out param:

declare @manid int
set @manid=2
exec GetImmediateManager 1,@manid output
select @manid


result is:

1 2

second result 

1















Original comment by [email protected] on 4 Apr 2012 at 10:57

@GoogleCodeExporter
Copy link
Author

Can we call GetImmediateManager without setting second parameter?

exec GetImmediateManager 1

Original comment by [email protected] on 4 Apr 2012 at 11:01

@GoogleCodeExporter
Copy link
Author

exec GetImmediateManager 1

Msg 201, Level 16, State 4, Procedure GetImmediateManager, Line 0
Procedure or function 'GetImmediateManager' expects parameter '@managerID', 
which was not supplied.


Original comment by [email protected] on 4 Apr 2012 at 11:08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant