mattn / go-oci8

Oracle driver for Go using database/sql
https://mattn.kaoriya.net/
MIT License
630 stars 212 forks source link

Stored procedure reports an error when the out parameter is null #332

Closed zhiyunliu closed 5 years ago

zhiyunliu commented 5 years ago

我这样解决请帮忙看看是否合理。

https://github.com/zhiyunliu/go-oci8/commit/8fd85141081b4c5855a68f3b1fd2de9511160195#diff-eaeb246e5dfb1f0b15828b3713028f45

mattn commented 5 years ago

Please write english.

zhiyunliu commented 5 years ago

title: Call the stored procedure and report an error when the out parameter is null. i used this way to solve it. is it fine. https://github.com/zhiyunliu/go-oci8/commit/8fd85141081b4c5855a68f3b1fd2de9511160195

mattn commented 5 years ago

What do you mean here?

https://github.com/zhiyunliu/go-oci8/commit/8fd85141081b4c5855a68f3b1fd2de9511160195#diff-eaeb246e5dfb1f0b15828b3713028f45R89

zhiyunliu commented 5 years ago

This is my modification code. just want to tell you what i changed.

zhiyunliu commented 5 years ago

sorry , my english is poor

mattn commented 5 years ago

okay, now i understood what you mean. thank you.

MichaelS11 commented 5 years ago

@zhiyunliu Can you please provide an SQL and PL/SQL example of the problem so we can make a test case?

zhiyunliu commented 5 years ago

It's incredible that using the new version of oci8 works well. I did not find any inconsistencies in acquisition errors. in my fork version ,it is still working error. create or replace procedure p_test_output(v_in varchar2, v_in2 number, v_n out number, v_b out varchar2) is begin v_n := 1; end; image

MichaelS11 commented 5 years ago

@zhiyunliu So there is no issue?

zhiyunliu commented 5 years ago

yeah,i suppose so.

zhiyunliu commented 5 years ago

well ,i want to known how to fix this in new version also.

zhiyunliu commented 5 years ago

there are same in getError. image

image

MichaelS11 commented 5 years ago

Are you asking how to fix ORA-01405? If so, did you try running your package in sql plus to see what is going on?

zhiyunliu commented 5 years ago

yes,the procedure works fine, but raise error in my fork version. image

image

MichaelS11 commented 5 years ago

In your Go code, try changing var pb string to var pb sql.NullString and let me know what happens.

zhiyunliu commented 5 years ago

raise [ORA-01405] error yet. image

zhiyunliu commented 5 years ago

i change my project to use the lastest version,so forget the issue now.then i have free time i will find what's the reason. thank you.