-
Notifications
You must be signed in to change notification settings - Fork 77
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
Question: Is the CLOB data type supported? #355
Comments
Hi @richardm90! Apologies I didn't see your issue until now, I use CLOB fields with node-odbc connecting to my IBMi at work without any issues on 7.4. If you could share a simplified example I'd be happy to take a look at what you are trying to do. |
Hi @brandonp42 and no problem, this is the test I was using. My stored procedure.
My Node.js app. This uses a DSN called MYIBMI to connect to my IBM i server.
Running the Node.js app gives me the following error.
If I change my stored procedure from using CLOBs to VARCHARs it works as expected.
|
Okay, I looked into this a little more today and you are right that calling stored procedures with CLOB parameters using the .callProcedure() function does not currently work. However if you return a result set with your variables using the .query() function it does work, here's an example:
The javascript code (I'm using async/await but you can still use callback functions):
|
Thanks @brandonp42 , I can get that to work. Is that how you need to work with CLOBs? Should you be able to use |
My opinion is that in an ideal world you should be able to use callProcedure with CLOBS but it seems like there needs to be a code update to support that. I haven't worked on this codebase before so I am not sure how easy/hard it would be. I was hoping that @markdirish would chime in - I'm willing to give it a try but he knows this codebase the best. Most of my efforts recently have been digging into the XMLSERVICE codebase and working on that - it uses CLOBS with stored procedures so I was really surprised initially when I saw your issue here. However, (when called from the nodejs toolkit) we're not doing the callProcedure function, it's using a call with a result set; that's why I suggested the workaround I gave you. It's maybe not the best solution but it seems to work as long as you don't need multiple result sets. I did a quick test with multiple result sets and it didn't work - when I get a chance to re-confirm and put a full example together I will open a new issue for that. |
Thanks for the update and this does answer my original question of "Are CLOBs supported?", which they are using |
I've been looking at how I can adapt my stored procedures to return a result set as the work around to the CLOB parameter problem and it's a bit of a faff. My stored procedures are all external stored procedures (call RPGLE program) so I'm thinking I'd need to create an additional SQL stored procedure that calls my external stored procedure and then returned the parameters as a result set. It just sounds like a lot of messing around. Should you be able to use callProcedure with CLOBS? Is this a bug? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still an open question |
odbc
Package Version: 2.4.8It looks to me as though the CLOB data type is still not supported but I wanted to check this for sure.
I created a simple SQL stored procedure with two parameters; one an input CLOB and the second an output CLOB. When I run my test Node.js App I get the following message.
Error: [odbc] Error binding parameters to the procedure
I've looked at the following similar issues, which (along with my test results) suggest that CLOB isn't currently supported.
I noticed in issue #137 this suggested an RFE had been raised. I checked the Ideas portal and I couldn't find one.
Is the CLOB data type supported?
The text was updated successfully, but these errors were encountered: