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

[PLSQL] ExecuteProcAsync tries to map BOOLEAN as Int16 #3763

Closed
gpgpublickey opened this issue Sep 7, 2022 · 4 comments
Closed

[PLSQL] ExecuteProcAsync tries to map BOOLEAN as Int16 #3763

gpgpublickey opened this issue Sep 7, 2022 · 4 comments

Comments

@gpgpublickey
Copy link

gpgpublickey commented Sep 7, 2022

When I try to execute a stored procedure passing a boolean output type, linq2db is trying to set that output type declaring it as int16 instead of boolean, triggering PLS-00306: wrong number or types of arguments in call to 'FOO_SP_NAME'

How to reproduce:
Create an stored procedure declaring an input varchar parameter, and output BOOLEAN parameter,
then try to execute it using ExecuteProcAsync passing the parameters indicating the boolean output type:

var hasSomeBoolValue = new DataParameter("FOO", false)
            {
                Direction = System.Data.ParameterDirection.Output,
                DataType = DataType.Boolean
            };

I know BOOLEAN cannot be used as part of sql but i believe should be working correctly for stored procedures

Any clue about how to achieve to call this kind of stored procedures?

@viceroypenguin
Copy link
Contributor

@gpgpublickey is there a difference between this request and #3740?

@gpgpublickey
Copy link
Author

gpgpublickey commented Sep 7, 2022

Yes, the #3740 issue is happening because boolean is not compatible for SQL, but in this case I'm trying to run a stored procedure, it's supposed to support BOOLEAN in that level, currently is not possibly to give a hint to linq2db to make it understand that a boolean type should be passed as output parameter, and seems to be ignoring or parsing incorrectly to an integer the hint specified in DataType for the data parameter.

Probably the way to improve it and make it work correctly could be related to #3740 but they are different issues, all will depend about how to separate concerns and let linq2db know which kind of type must be used to represent the boolean (number for sql, BOOLEAN for packages, sps, etc)

@MaceWindu
Copy link
Contributor

This is related to #3740 actually. Right now we convert booleans to integers in oracle provider. #3754 fix it but it is not proper/complete fix as it breaks backward compatibility

@gpgpublickey
Copy link
Author

gpgpublickey commented Sep 8, 2022

I see, same root cause different issue, thx for the clarification, it is not clear how this affects backward compatibility if an stored procedure with a int type on data parameter instead of boolean will fail anyway calling the procedure.

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

No branches or pull requests

3 participants