Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with SQLBindParameter() or SQLExecDirect() fnct.

Status
Not open for further replies.

golyg

Programmer
Jul 22, 2002
319
US
Hi all,
I have an vc++ 6.0 application that is using the SQLBindParameter() to bind a field that is of type LONG, to a SQL statement that is already constructed since Oracle will not allow us to pass a string literal longer than 2000 characters, and this LONG is being setup with a max of 4000.
This app is also using the SQLExecDirect() function to execute the SQL.
It appears that when I bind the 2 statements, I am filling up the buffer(set to 4000) with junk data.
So then when I call the SQLExecDirect() function, I insert junk.

does anyone have any experience with this?

thanks,
 
you should not use SQLBindParameter() with SQLSexecDirect.

use sequence

SQLPerpare
SQLBindParameter
SQLExecute


Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
thanks for the post..
I am attempting to omit the SQLBind statement..
Is oracle9i more friendly with strings larger than 2000 now?

It appears that I can but...

 
I think the question is if ODBC Is more friendly ...., not oracle. If you want to use CLOB, BLOB strings, you should use SQLPutData. So, you can send more than for example 65,535 bytes. By the way, you can use OCI or OO4O instead of ODBC. OCI is the OracleCallInterface and OO4O is an OLE model based on OCI, called Ole Objects For Oracle.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Thanks for all your input...I will look into the SQLPutData().
Are you saying to use the SQLPutData rather than SQLExecute?

again, thanks for all your help.
 
use SQLExecute anyway. SQLPutData you will use to enter data, not to execute the statement.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top