473,324 Members | 2,417 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,324 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 2622

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.