Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Oracle Stored procedures with ODBC
I am experiencing problems using Oracle stored procedures with ODBC
(Oracle v8.0.3.0,
ODBC Driver v8.0.3.0.0, O/S WinNT Wks 4.0 SP3 on server & client).
I have a stored procedure with an output parameter of type VARCHAR2. I wish to call this procedure via ODBC, with the result being stored in a char array in C++. I bind the parameter in ODBC with SQLBindParameter(). The last parameter to the bind call is the StrLen_or_IndPtr (according to the documentation). For this, I pass a pointer to an automatic variable, which initially contains the width of the char buffer (this is the only value that seems to work, using 0 or SQL_NTS or such like gives me an ODBC error "Unable to ascertain cause of error"). With the buffer width as the initial value, the correct data is placed in the buffer, but the buffer is padded out with rubbish. This was placed here by the ODBC driver, as the buffer was zeroed previously. This would be fine, if the actual length of the data were placed in the StrLen_or_IndPtr pointer (it is not, the value remains the same after calling SQLExecute()). I have tested the stored procedure in isolation and it works fine.
Has anyone encountered this problem? Does anyone know how I can retrieve the length of the data in a simple and elegant manner ? I would like to avoid using a direct SELECT statement in this instance.
Thanks,
Matt.
Matt Innes, Tektronix Lightworks Products
matt.innes_at_tek.com
+44 171 4626271
Received on Tue Jan 05 1999 - 08:32:30 CST
![]() |
![]() |