473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

OCI: generic binds

I'm quite new to using OCI and I'm trying to find a way of creating a
function to handle all store procedures in a database, problem I'm
having is with the OCIBindByPos function and how to make the type of
data being returned/input to the stored procedure generic.

I the following set up....

..
..
..
char * arrData[200];
..
..
..

/* get the number of arguments*/
checkerr(errhp, OCIAttrGet((dvoid *) arglist, OCI_DTYPE_PARAM,
(dvoid*)numArgs, (ub4*)0,(ub4)OCI_ATTR_NUM_PARAMS , errhp));

for (i=1; i<=numArgs;i++) {

OCIParamGet (arglist, OCI_DTYPE_PARAM, errhp, &arg, i);

OCIAttrGet ((dvoid *)arg, OCI_DTYPE_PARAM, (dvoid*)&atypecode,
(ub4*)0, OCI_ATTR_DATA_TYPE, errhp);

OCIAttrGet ((dvoid *)arg, OCI_DTYPE_PARAM, (dvoid*)&amaxsize,
(ub4*)0, OCI_ATTR_DATA_SIZE, errhp);

checkerr( errhp, OCIBindByPos(stmthp, (dvoid*)&arrOCIBind[i],
errhp, i, &arrData[i] ,(sword)amaxsize , atypecode , (dvoid *) 0,(ub2
*) 0, (ub2) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT));
}
running my test harness for a stored procedure which takes two params,
a SQLT_INT and SQLT_AFC out I get "OCI_NO_DATA found" from which
suggests to me that data is being druncated.

Can anyone suggest what I need to change? Or is there another way
altogether i should be going about this? any sample code would go down
a treat!!

Thanks,

Andy.
Jul 19 '05 #1
0 2628

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sheela | last post by:
hi all, I have some problem trying to connect to an oracle DB, I don't realy understand how to use the oci libraries, some one can please help me? SHE -- Posted via Mailgate.ORG Server -...
3
by: David | last post by:
Hello all, I have been trying to use the OCI driver to connect to Oracle 9i, but have been getting the following error: java.sql.SQLException: Closed Connection at...
1
by: tornado | last post by:
hi all, can any one point me to OCI wrapper libraries for c++/c (except OTL by skuchin)? it will be of great help. thanks in advance.
0
by: Anand Mamuder | last post by:
Greetings, I have a table MYTABLE ( msg_id RAW(24) NOT NULL) , .....) msg_id is the key, If I wanted to select a record using the OCI, the select is failing. I can see that the value exists...
1
by: gavs | last post by:
Hi, I have written a small C code to test with OCI calls (OCI Initialize, OCIEnvInit etc). The program is called myprog.C. The OS is AIX 5.2. myprog.C #include<oci.h> // This is in...
1
by: rotarinn | last post by:
Hi, I am using VisualStudio.NET 2003 trying to connect to an Oracle Database (version 8.0.5). I have created the connection using "Microsoft OleDBProvider for Oracle" and when I click on Test...
1
by: RTJ | last post by:
I have experienced problems with Oracle OCI library. I was unable to properly link OCI library using gcc. Probably gcc compiler provided with SFU is unable to link native Windows library. Oracle...
4
by: news.microsoft.com | last post by:
Hello, Another issue has risen after installing Visual Studio 2005. When I use OracleClient with ASP.NET v1.1 I receive an error stating it can't load OCI.DLL. This has never been a issue...
0
by: Andy | last post by:
I'm quite new to using OCI and I'm trying to find a way of creating a function to handle all store procedures in a database, problem I'm having is with the OCIBindByPos function and how to make the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.