OCIBindDynamic()
Can i use OCIBindDynamic() to bind INPUT variables ? Sometimes i get "ORA-03113 end-of-file on communication channel" error when i use callbacks for INPUT variables, the problem in callbacks or not ?
Thanks
All the data sent in one piece (SQLT_INT, SQLT_FLT, SQLT_DAT, SQLT_STR). Strings are small. The application is app server and have many connections to Oracle Server, each connection have self OCIEnv. When end-of-file appears on one client (after DML operation with callbacks), all other clients have same error on similar DML operations. Reboot server machine helps stop the errors :(
Similar Messages
-
Using OCIBindDynamic with non-blocking connections
I need to use an OCI array interface for execute statements more than once per one request to server.
When I have called stored procedure or function in the non-blocking connection context using OCIBindDynamic for parameter binding, application have been crashed at random time.
I don't have any problems using default (blocking) mode.
Environment:
Oracle 8.1.7 release 3 for Windows
MS Visual C++ 6.0 compiler
Could anybody help me ?It's always possible in any read that the number of bytes read is less than the number of bytes requested. You need to keep reading until you have got everything you expected, and cope with every possible error condition on each iteration.
EJP -
OCI8 OCIBindDynamic failure to callback on random columns over multiple rows
I am developing a set of bindings to Oracle for Python; see http://www.zope.org/Members/matt/dco2
When attempting to implement Python's executemany() method of the Python DB API, the code sets up a set of columns which are marked as DATA_AT_EXEC when bound, and a subsequent OCIBindDynamic is issued to set up the input callback.
This works, and I can have multiple rows retrieved in this fashion, EXECEPT that sometimes, Oracle does NOT call back a column, and will attempt to insert NULL for this column instead. The row/column for which this happens is apparently random, and the incidence of this is timing related (reducing the batch size also helps).
Has anyone got any idea if this is a legitimate bug in the transport interface? I have trace tables in my bindings which clearly demonstrate that a callback does NOT occur on random columns.I've seen this problem with 8.0.5, 8.1.6, 8.1.7 on Linux (I test on 4 different machines, with various distributions), and 8.1.7 on Solaris.
I am interested in trying to keep things bound DATA_AT_EXEC to keep the code paths simplified, so I'd like to figure it out and fix it. -
Unable to compile PHP on pSeries AIX 5.1
Hello, I have Oracle 9.2 installed and running ok.
When I try to compile PHP with oci8 support, this is what I get:
nd/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lintl -lgdbm -lm -ldl -lm -lodm -lbsd_r -lld -lperfstat -lclntsh -o sapi/cli/php
ar: 0707-101 . is not a valid flag.
make: *** [libphp4.la] Error 1
make: *** Waiting for unfinished jobs....
ld: 0711-317 ERROR: Undefined symbol: .OCIEnvInit
ld: 0711-317 ERROR: Undefined symbol: .OCIHandleAlloc
ld: 0711-317 ERROR: Undefined symbol: .OCIInitialize
ld: 0711-317 ERROR: Undefined symbol: .OCIHandleFree
ld: 0711-317 ERROR: Undefined symbol: .OCITransRollback
ld: 0711-317 ERROR: Undefined symbol: .OCIDescriptorFree
ld: 0711-317 ERROR: Undefined symbol: .OCIErrorGet
ld: 0711-317 ERROR: Undefined symbol: .OCIServerVersion
ld: 0711-317 ERROR: Undefined symbol: .OCIDescriptorAlloc
ld: 0711-317 ERROR: Undefined symbol: .OCIAttrSet
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtPrepare
ld: 0711-317 ERROR: Undefined symbol: .OCIAttrGet
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtExecute
ld: 0711-317 ERROR: Undefined symbol: .OCIParamGet
ld: 0711-317 ERROR: Undefined symbol: .OCIDefineByPos
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtFetch
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtSetPieceInfo
ld: 0711-317 ERROR: Undefined symbol: .OCILobGetLength
ld: 0711-317 ERROR: Undefined symbol: .OCILobRead
ld: 0711-317 ERROR: Undefined symbol: .OCILobFileClose
ld: 0711-317 ERROR: Undefined symbol: .OCILobFileOpen
ld: 0711-317 ERROR: Undefined symbol: .OCISessionBegin
ld: 0711-317 ERROR: Undefined symbol: .OCISessionEnd
ld: 0711-317 ERROR: Undefined symbol: .OCIServerAttach
ld: 0711-317 ERROR: Undefined symbol: .OCIServerDetach
ld: 0711-317 ERROR: Undefined symbol: .OCIBindByName
ld: 0711-317 ERROR: Undefined symbol: .OCIBindObject
ld: 0711-317 ERROR: Undefined symbol: .OCIBindDynamic
ld: 0711-317 ERROR: Undefined symbol: .OCILobWrite
ld: 0711-317 ERROR: Undefined symbol: .OCITransCommit
ld: 0711-317 ERROR: Undefined symbol: .OCIPasswordChange
ld: 0711-317 ERROR: Undefined symbol: .OCIObjectFree
ld: 0711-317 ERROR: Undefined symbol: .OCICollAppend
ld: 0711-317 ERROR: Undefined symbol: .OCINumberFromReal
ld: 0711-317 ERROR: Undefined symbol: .OCIDateFromText
ld: 0711-317 ERROR: Undefined symbol: .OCIStringAssignText
ld: 0711-317 ERROR: Undefined symbol: .OCICollGetElem
ld: 0711-317 ERROR: Undefined symbol: .OCINumberToReal
ld: 0711-317 ERROR: Undefined symbol: .OCIDateToText
ld: 0711-317 ERROR: Undefined symbol: .OCIStringPtr
ld: 0711-317 ERROR: Undefined symbol: .OCICollAssign
ld: 0711-317 ERROR: Undefined symbol: .OCICollAssignElem
ld: 0711-317 ERROR: Undefined symbol: .OCICollSize
ld: 0711-317 ERROR: Undefined symbol: .OCICollMax
ld: 0711-317 ERROR: Undefined symbol: .OCICollTrim
ld: 0711-317 ERROR: Undefined symbol: .OCITypeByName
ld: 0711-317 ERROR: Undefined symbol: .OCIDescribeAny
ld: 0711-317 ERROR: Undefined symbol: .OCITypeByRef
ld: 0711-317 ERROR: Undefined symbol: .OCIObjectNew
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make: *** [sapi/cli/php] Error 1
I am using gcc 3.3.3.
./configure output:
checking for Oracle-OCI8 support... yes
checking Oracle Install-Dir... /oracle/product/920
checking Oracle version... 8.1
checking for OCILobIsTemporary in -lclntsh... (cached) no
checking for OCILobIsTemporary in -locijdbc8... (cached) no
I already type gencltsh as user oracle. Perhaps this is a problem with PHP trying to read 64 bit libs while running on 32 bit mode ? Anyone has been thru this ?
Any hints ?
Thanks,
ÃlvaroMaybe my bug report http://bugs.php.net/bug.php?id=31345
can help you, and also
http://bugs.php.net/bug.php?id=31001
because i remembre have same message when I was searching for my problems
Regards -
A Bug in 11.1 array interface
I have just encounter some code that runs fine in Oracle 9 to 10 but in 11.1 I am getting a different result.
basically I have this SQL
"INSERT INTO $table ( row_1, row_2, row_3) VALUES (?,?,?)"
and bind all three to this array
@var2 = (2,2,2,2,'s',2,2,2,2,2);
using OCIBindByName and OCIBindDynamic and then execute them with
OCIStmtExecute, with a mode (IN)
of OCI_BATCH_ERRORS OCI_COMMIT_ON_SUCCESS (or 160)
what happens is the commit does not happen in 11 but does happen in 9~10?
Did something change in the execute in 11 or should I raise this up to a bug status??Ok here is a trace of the OCI Calls I use, and yes I the last one I give is a OCITransCommit
st_execute_array INSERT count=10 (ARRAY(0x1a725c8) ARRAY(0x1a934c4) undef)
OCIBindByName(876dad8,19cab00,8755e68,":p1",3,0,1,1,0,0,0,0,0,DATA_AT_EXEC)=SUCCESS
OCIBindDynamic(876eda8,8755e68,19caadc, phs_in,19caadc,phs_out)=SUCCESS
OCIBindByName(876dad8,1a27810,8755e68,":p2",3,0,1,1,0,0,0,0,0,DATA_AT_EXEC)=SUCCESS
OCIBindDynamic(876ec68,8755e68,1a277ec,phs_in,1a277ec,phs_out)=SUCCESS
OCIBindByName(876dad8,1a2bc18,8755e68,":p3",3,0,1,1,0,0,0,0,0,DATA_AT_EXEC)=SUCCESS
OCIBindDynamic(876eb28,8755e68,1a2bbf4,phs_in,1a2bbf4,phs_out)=SUCCESS
OCIStmtExecute(8755db0,876dad8,8755e68,10,0,0,0,160)=SUCCESS_WITH_INFO ->(OCI_BATCH_ERRORS|OCI_COMMIT_ON_SUCCESS)<--
OCIAttrGet(876dad8,OCI_HTYPE_STMT,140f4ec,0,129,8755e68)=SUCCESS
OCIErrorGet(8755e68,1,"<NULL>",140f48c,"ORA-24381: error(s) in array DML",1024,2)=SUCCESS
OCIErrorGet(8755e68,2,"<NULL>",140f48c,"ORA-24381: error(s) in array DML",1024,2)=NO_DATA
OCIAttrGet(876dad8,OCI_HTYPE_STMT,140f55c,0,73,8755e68)=SUCCESS
st_execute_array 1 errors in batch.
OCIHandleAlloc(8727940,140f578,OCI_HTYPE_ERROR,0,0)=SUCCESS
OCIHandleAlloc(8727940,140f570,OCI_HTYPE_ERROR,0,0)=SUCCESS
OCIParamGet(8755e68,2,876c3c0,140f578,0)=SUCCESS
OCIAttrGet(876c968,OCI_HTYPE_ERROR,140f550,0,74,8755e68)=SUCCESS
st_execute_array error in row 4.
OCIErrorGet(876c968,1,"<NULL>",140f4cc,"ORA-01722: invalid number",1024,2)=SUCCESS
OCIErrorGet(876c968,2,"<NULL>",140f4cc,"ORA-01722: invalid number",1024,2)=NO_DATA
OCIHandleFree(876c3c0,OCI_HTYPE_ERROR)=SUCCESS
OCIHandleFree(876c968,OCI_HTYPE_ERROR)=SUCCESS
OCITransCommit(8755db0,8755e68,0)=SUCCESS
st_execute_array warning: ORA-24381: error(s) in array DML (SUCCESS_WITH_
INFO: error possibly near <*> indicator at char 56 in 'INSERT INTO test_ea( row_1, row_2,
row_3) VALUES (:p1,:<*>p2,:p3)') [for Statement "INSERT INTO test_ea( row_1, row_2, row_
3) VALUES (?,?,?)"]
and here is the code snipits but it is take out of a larger program so I will not run
sb4
phs_in(dvoid octxp, OCIBind bindp, ub4 iter, ub4 index,
dvoid **bufpp, ub4 alenp, ub1 piecep, dvoid **indpp)
phs_t phs = (phs_t)octxp;
STRLEN phs_len;
AV *tuples_av;
SV *sv;
AV *av;
SV **sv_p;
/* Check for bind values supplied by tuple array. */
tuples_av = phs->imp_sth->bind_tuples;
if(tuples_av) {
/* NOTE: we already checked the validity in ora_st_bind_for_array_exec(). */
sv_p = av_fetch(tuples_av, phs->imp_sth->rowwise ? (int)iter : phs->idx, 0);
av = (AV*)SvRV(*sv_p);
sv_p = av_fetch(av, phs->imp_sth->rowwise ? phs->idx : (int)iter, 0);
sv = *sv_p;
if(SvOK(sv)) {
*bufpp = SvPV(sv, phs_len);
phs->alen = (phs->alen_incnull) ? phs_len+1 : phs_len;
phs->indp = 0;
} else {
*bufpp = SvPVX(sv);
phs->alen = 0;
phs->indp = -1;
*alenp = phs->alen;
*indpp = &phs->indp;
*piecep = OCI_ONE_PIECE;
if (!tuples_av && (index > 0 || iter > 0))
croak(" Arrays and multiple iterations not currently supported (in %d/%d)", index,iter);
return OCI_CONTINUE;
sb4
phs_out(dvoid octxp, OCIBind bindp,
ub4 iter, /* execution itteration (0...) */
ub4 index, /* array index (0..) */
dvoid **bufpp, /* A pointer to a buffer to write the bind value/piece. */
ub4 **alenpp, /* A pointer to a storage for OCI to fill in the size */
/* of the bind value/piece after it has been read. */
ub1 piecep, / */
dvoid **indpp, /* Return a pointer to contain the indicator value which either an sb2 */
/* value or a pointer to an indicator structure for named data types. */
ub2 **rcodepp) /* Returns a pointer to contains the return code. */
phs_t phs = (phs_t)octxp; /* context */
if (phs->desc_h) { /* a descriptor if present (LOBs etc)*/
*bufpp = phs->desc_h;
phs->alen = 0;
} else {
SV *sv = phs->sv;
if (SvTYPE(sv) == SVt_RV && SvTYPE(SvRV(sv)) == SVt_PVAV) {
sv = av_fetch((AV)SvRV(sv), (IV)iter, 1);
if (!SvOK(sv))
sv_setpv(sv,"");
bufpp = SvGROW(sv, (size_t)(((phs->maxlen < 28) ? 28 : phs->maxlen)+1)/for null*/);
phs->alen = SvLEN(sv); /* max buffer size now, actual data len later */
*alenpp = &phs->alen;
*indpp = &phs->indp;
*rcodepp= &phs->arcode;
*piecep = OCI_ONE_PIECE;
return OCI_CONTINUE;
static int
do_bind_array_exec(sth, imp_sth, phs)
SV *sth;
imp_sth_t *imp_sth;
phs_t *phs;
dTHX;
sword status;
OCIBindByName_log(imp_sth->stmhp, &phs->bndhp, imp_sth->errhp,
(text*)phs->name, (sb4)strlen(phs->name),
0,
phs->maxlen ? (sb4)phs->maxlen : 1, /* else bind "" fails */
(ub2)phs->ftype, 0,
NULL, /* ub2 alen_ptr not needed with OCIBindDynamic /
0,
0, /* max elements that can fit in allocated array */
NULL, /* (ptr to) current number of elements in array */
(ub4)OCI_DATA_AT_EXEC,
status);
if (status != OCI_SUCCESS) {
oci_error(sth, imp_sth->errhp, status, "OCIBindByName");
return 0;
OCIBindDynamic_log(phs->bndhp, imp_sth->errhp,
(dvoid *)phs, phs_in,
(dvoid *)phs, phs_out, status);
if (status != OCI_SUCCESS) {
oci_error(sth, imp_sth->errhp, status, "OCIBindDynamic");
return 0;
return 1;
static void
init_bind_for_array_exec(phs)
phs_t *phs;
dTHX;
if (phs->sv == &sv_undef) { /* first bind for this placeholder */
phs->is_inout = 0;
phs->maxlen = 1;
/* treat Oracle7 SQLT_CUR as SQLT_RSET for Oracle8 */
if (phs->ftype==102)
phs->ftype = 116;
/* some types require the trailing null included in the length. */
/* SQLT_STR=5=STRING, SQLT_AVC=97=VARCHAR */
phs->alen_incnull = (phs->ftype==SQLT_STR || phs->ftype==SQLT_AVC);
int
st_execute_array(sth, imp_sth, tuples, tuples_status, columns, exe_count)
SV *sth;
imp_sth_t *imp_sth;
SV *tuples;
SV *tuples_status;
SV *columns;
ub4 exe_count;
sword status, exe_status;
int is_select = (imp_sth->stmt_type == OCI_STMT_SELECT);
AV tuples_av, tuples_status_av, *columns_av;
ub4 oci_mode;
ub4 num_errs;
int i,j;
int autocommit = 1;
SV **sv_p;
phs_t **phs;
SV *sv;
AV *av;
int param_count;
char namebuf[30];
STRLEN len;
int outparams = (imp_sth->out_params_av) ? AvFILL(imp_sth->out_params_av)+1 : 0;
tuples_av = (AV*)SvRV(tuples);
/* Check the `columns' parameter. */
if(SvTRUE(columns)) {
if(!SvROK(columns) || SvTYPE(SvRV(columns)) != SVt_PVAV) {
croak("ora_st_execute_array(): columns not an array peference.");
columns_av = (AV*)SvRV(columns);
} else {
columns_av = NULL;
/* Check the `tuples_status' parameter. */
if(SvTRUE(tuples_status)) {
if(!SvROK(tuples_status) || SvTYPE(SvRV(tuples_status)) != SVt_PVAV) {
croak("ora_st_execute_array(): tuples_status not an array reference.");
tuples_status_av = (AV*)SvRV(tuples_status);
av_fill(tuples_status_av, exe_count - 1);
/* Fill in 'unknown' exe count in every element (know not how to get
individual execute row counts from OCI). */
for(i = 0; (unsigned int) i < exe_count; i++) {
av_store(tuples_status_av, i, newSViv((IV)-1));
} else {
tuples_status_av = NULL;
/* Nothing to do if no tuples. */
if(exe_count <= 0)
return 0;
param_count=c_NUM_PARAMS(imp_sth);/*returns the # of parameters on the imp_sth struct*/
phs = safemalloc(param_count*sizeof(*phs));
memset(phs, 0, param_count*sizeof(*phs));
for(j = 0; (unsigned int) j < exe_count; j++) {
sv_p = av_fetch(tuples_av, j, 0);
if(sv_p == NULL) {
Safefree(phs);
croak("Cannot fetch tuple %d", j);
sv = *sv_p;
if(!SvROK(sv) || SvTYPE(SvRV(sv)) != SVt_PVAV) {
Safefree(phs);
croak("Not an array ref in element %d", j);
av = (AV*)SvRV(sv);
for(i = 0; i < param_count; i++) {
if(!phs) {
SV **phs_svp;
sprintf(namebuf, ":p%d", i+1);
phs_svp = hv_fetch(imp_sth->all_params_hv,
namebuf, strlen(namebuf), 0);
if (phs_svp == NULL) {
Safefree(phs);
croak("Can't execute for non-existent placeholder :%d", i);
phs[i] = (phs_t*)(void*)SvPVX(*phs_svp); /* placeholder struct */
if(phs[i]->idx < 0) {
Safefree(phs);
croak("Placeholder %d not of ?/:1 type", i);
init_bind_for_array_exec(phs[i]); /*bind the value */
sv_p = av_fetch(av, phs[i]->idx, 0);
if(sv_p == NULL) {
Safefree(phs);
croak("Cannot fetch value for param %d in entry %d", i, j);
sv = *sv_p;
/*check to see if value sv is a null (undef) if it is upgrade it*/
if (!SvOK(sv)) {
if(SvUPGRADE(sv, SVt_PV)){} /* For GCC not to warn on unused result */
else {
SvPV(sv, len);
/* Find the value length, and increase maxlen if needed. */
if(SvROK(sv)) {
Safefree(phs);
croak("Can't bind a reference (%s) for param %d, entry %d",
neatsvpv(sv,0), i, j);
if(len > (unsigned int) phs[i]->maxlen)
phs[i]->maxlen = len;
/* Do OCI bind calls on last iteration. */
if( ((unsigned int) j ) == exe_count - 1 ) {
if(!do_bind_array_exec(sth, imp_sth, phs[i])) {
Safefree(phs);
Safefree(phs);
/* Store array of bind typles, for use in OCIBindDynamic() callback. */
imp_sth->bind_tuples = tuples_av;
imp_sth->rowwise = (columns_av == NULL);
oci_mode = OCI_BATCH_ERRORS;
if(autocommit)
oci_mode |= OCI_COMMIT_ON_SUCCESS;
OCIStmtExecute_log(imp_sth->svchp, imp_sth->stmhp, imp_sth->errhp,
exe_count, 0, 0, 0, oci_mode, exe_status);
imp_sth->bind_tuples = NULL;
if (exe_status != OCI_SUCCESS) {
oci_error(sth, imp_sth->errhp, exe_status, ora_sql_error(imp_sth,"OCIStmtExecute"));
if(exe_status != OCI_SUCCESS_WITH_INFO)
return -2;
OCIAttrGet_log(imp_sth, &num_errs, 0, OCI_ATTR_NUM_DML_ERRORS, status);
if(num_errs && tuples_status_av) {
OCIError row_errhp, tmp_errhp;
ub4 row_off;
SV *err_svs[2];
/*AV err_av;/
sb4 err_code;
err_svs[0] = newSViv((IV)0);
err_svs[1] = newSVpvn("", 0);
OCIHandleAlloc_log(imp_sth->envhp, &row_errhp, OCI_HTYPE_ERROR, status);
OCIHandleAlloc_log(imp_sth->envhp, &tmp_errhp, OCI_HTYPE_ERROR, status);
for(i = 0; (unsigned int) i < num_errs; i++) {
OCIParamGet_log(imp_sth->errhp, OCI_HTYPE_ERROR,
tmp_errhp, (dvoid *)&row_errhp,
(ub4)i, status);
OCIAttrGet_log(row_errhp, OCI_HTYPE_ERROR, &row_off, 0,
OCI_ATTR_DML_ROW_OFFSET, imp_sth->errhp, status);
sv_setpv(err_svs[1], "");
err_code = oci_error_get(row_errhp, exe_status, NULL, err_svs[1], debug);
sv_setiv(err_svs[0], (IV)err_code);
av_store(tuples_status_av, row_off,
newRV_noinc((SV *)(av_make(2, err_svs))));
OCIHandleFree_log(tmp_errhp, OCI_HTYPE_ERROR, status);
OCIHandleFree_log(row_errhp, OCI_HTYPE_ERROR, status);
/* Do a commit here if autocommit is set, since Oracle
doesn't do that for us when some rows are in error. */
if(autocommit) {
OCITransCommit_log(imp_sth->svchp, imp_sth->errhp,
OCI_DEFAULT, status);
if (status != OCI_SUCCESS) {
oci_error(sth, imp_sth->errhp, status, "OCITransCommit");
return -2;
if(num_errs) {
return -2;
} else {
ub4 row_count = 0;
OCIAttrGet_stmhp_log(imp_sth, &row_count, 0, OCI_ATTR_ROW_COUNT, status);
return row_count; -
Oracle 8i array DML operations with LOB objects
Hi all,
I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
Chris Simms
[email protected]
nullBefore 9i, you will have to first insert empty locators using EMPTY_CLOB() inlined in the SQL and using RETURNING clause to return the locator. Then use OCILobWrite to write to the locators in a streamed fashion.
From 9i, you can actually bind a long buffer to each lob position without first inserting an empty locator, retrieving it and then writing to it.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by CSimms:
Hi all,
I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
Chris Simms
[email protected]
<HR></BLOCKQUOTE>
null -
PHP 5.2.2 with Oracle support on AIX5.3 aix64
Hello,
I am trying to compile PHP 5.2.2 with Oracle Instant Client support on an AIX 5.3 64 bit system.
(Below, $CV contains /opt/freeware/CV2)
I have installed Oracle Instant Client 10.1 (both base and sdk for AIX 64 bit) in directory: $CV/instantclient10_1
I have executed the following commands in that directory:
# ln -s libclntsh.a libclntsh.so
# ln -s libclntsh.a libclntsh.so.10.1
configure doesn't accept Oracle Instant Client 10.2.
The configure line for PHP is as follows:
./configure prefix=$CV with-apxs2=$CV/apache2/bin/apxs with-config-file-path=$CV/lib with-gd with-pear with-gettext with-mime-magic with-zlib-dir=/opt/freeware/lib with-png with-zlib with-jpeg-dir=/opt/freeware/lib with-png-dir=/opt/freeware/lib with-freetype-dir=/opt/freeware/lib with-mysql=$CV/mysql with-oci8=instantclient,$CV/instantclient10_1 enable-sigchild
Configure runs fine but when I run gmake, I get the following errors:
In file included from /opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c:50:
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/php_oci8_int.h:354: error: parse error before 'oraub8'
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c: In function 'php_oci_init_global_handles':
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c:436: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c: In function 'php_oci_fetch_errmsg':
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c:925: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c:932: warning: pointer targets in passing argument 1 of '_estrndup' differ in signedness
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c:932: warning: pointer targets in assignment differ in signedness
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c: In function 'php_oci_do_connect_ex':
/opt/freeware/BUILD/CV2/php-5.2.2/ext/oci8/oci8.c:1044: warning: pointer targets in passing argument 2 of 'OCINlsCharSetNameToId' differ in signedness
gmake: *** [ext/oci8/oci8.lo] Error 1
I have also tried "--with-oci8-instant-client=$CV/instantclient10_1" instead of --with-oci8=... on the configure command line. That configured fine and gmake finished succesfully but when I tried, none of the oci_ or oci functions were known.
I have seen this problem a few number of times on the internet but nobody was able to provide a solution. PHP claims: "This is Oracle bug 4901517." but I have been unable to find it.
Can someone please help me out?
THANX.
Greetinx
JohanHi,
I am having the same issue, (php 5.1.4, AIX 5.2, instant client 10.1). I tried cj's solution, it got me up to the linking part, but dies when trying to create sapi/cgi/php with a lot of undefined symbols.
From the instructions I set the LIBPATH=/my_instant_client_dir.
Has anyone found what oratypes.h need to be changed to? Did this work for anyone else?
ld: 0711-317 ERROR: Undefined symbol: .OCIEnvInit
ld: 0711-317 ERROR: Undefined symbol: .OCIHandleAlloc
ld: 0711-317 ERROR: Undefined symbol: .OCIErrorGet
ld: 0711-317 ERROR: Undefined symbol: .OCIHandleFree
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtPrepare2
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtRelease
ld: 0711-317 ERROR: Undefined symbol: .OCIAttrSet
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtFetch
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtSetPieceInfo
ld: 0711-317 ERROR: Undefined symbol: .OCIStmtExecute
ld: 0711-317 ERROR: Undefined symbol: .OCIAttrGet
ld: 0711-317 ERROR: Undefined symbol: .OCIParamGet
ld: 0711-317 ERROR: Undefined symbol: .OCIDescriptorFree
ld: 0711-317 ERROR: Undefined symbol: .OCIDefineByPos
ld: 0711-317 ERROR: Undefined symbol: .OCIDescriptorAlloc
ld: 0711-317 ERROR: Undefined symbol: .OCILobGetLength
ld: 0711-317 ERROR: Undefined symbol: .OCILobFileClose
ld: 0711-317 ERROR: Undefined symbol: .OCILobFileOpen
ld: 0711-317 ERROR: Undefined symbol: .OCILobCharSetId
ld: 0711-317 ERROR: Undefined symbol: .OCILobRead2
ld: 0711-317 ERROR: Undefined symbol: .OCILobWrite
ld: 0711-317 ERROR: Undefined symbol: .OCILobDisableBuffering
ld: 0711-317 ERROR: Undefined symbol: .OCILobEnableBuffering
ld: 0711-317 ERROR: Undefined symbol: .OCILobCopy
ld: 0711-317 ERROR: Undefined symbol: .OCILobClose
ld: 0711-317 ERROR: Undefined symbol: .OCILobIsTemporary
ld: 0711-317 ERROR: Undefined symbol: .OCILobFreeTemporary
ld: 0711-317 ERROR: Undefined symbol: .OCILobFlushBuffer
ld: 0711-317 ERROR: Undefined symbol: .OCILobAppend
ld: 0711-317 ERROR: Undefined symbol: .OCILobTrim
ld: 0711-317 ERROR: Undefined symbol: .OCILobErase
ld: 0711-317 ERROR: Undefined symbol: .OCILobIsEqual
ld: 0711-317 ERROR: Undefined symbol: .OCILobCreateTemporary
ld: 0711-317 ERROR: Undefined symbol: .OCILobOpen
ld: 0711-317 ERROR: Undefined symbol: .OCIDateToText
ld: 0711-317 ERROR: Undefined symbol: .OCIBindByName
ld: 0711-317 ERROR: Undefined symbol: .OCIBindObject
ld: 0711-317 ERROR: Undefined symbol: .OCIBindDynamic
ld: 0711-317 ERROR: Undefined symbol: .OCIDateFromText
ld: 0711-317 ERROR: Undefined symbol: .OCITypeByName
ld: 0711-317 ERROR: Undefined symbol: .OCIDescribeAny
ld: 0711-317 ERROR: Undefined symbol: .OCITypeByRef
ld: 0711-317 ERROR: Undefined symbol: .OCIObjectNew
ld: 0711-317 ERROR: Undefined symbol: .OCICollSize
ld: 0711-317 ERROR: Undefined symbol: .OCICollMax
ld: 0711-317 ERROR: Undefined symbol: .OCICollTrim
ld: 0711-317 ERROR: Undefined symbol: .OCICollAppend
ld: 0711-317 ERROR: Undefined symbol: .OCINumberFromReal
ld: 0711-317 ERROR: Undefined symbol: .OCIStringAssignText
ld: 0711-317 ERROR: Undefined symbol: .OCICollGetElem
ld: 0711-317 ERROR: Undefined symbol: .OCINumberToReal
ld: 0711-317 ERROR: Undefined symbol: .OCIStringPtr
ld: 0711-317 ERROR: Undefined symbol: .OCICollAssignElem
ld: 0711-317 ERROR: Undefined symbol: .OCICollAssign
ld: 0711-317 ERROR: Undefined symbol: .OCIObjectFree
ld: 0711-317 ERROR: Undefined symbol: .OCIEnvNlsCreate
ld: 0711-317 ERROR: Undefined symbol: .OCIServerAttach
ld: 0711-317 ERROR: Undefined symbol: .OCISessionBegin
ld: 0711-317 ERROR: Undefined symbol: .OCIPasswordChange
ld: 0711-317 ERROR: Undefined symbol: .OCINlsCharSetNameToId
ld: 0711-317 ERROR: Undefined symbol: .OCINlsEnvironmentVariableGet
ld: 0711-317 ERROR: Undefined symbol: .OCIServerVersion
ld: 0711-317 ERROR: Undefined symbol: .OCITransRollback
ld: 0711-317 ERROR: Undefined symbol: .OCITransCommit
ld: 0711-317 ERROR: Undefined symbol: .OCIServerDetach
ld: 0711-317 ERROR: Undefined symbol: .OCISessionEnd -
OCI under windows2000 compile error
oracle: windows2000
develop tool: vc++
I want to write a class to do insert, update, delete, select, etc.
the connection have successed
but when i do the insert using 'OCIBindDynamic', the following error is out:
error C2664: 'OCIBindDynamic' : cannot convert parameter 4 from 'int (void *,struct OCIBind *,unsigned int,unsigned int,void ** ,unsigned int *,unsigned char *,void ** )' to 'int (__cdecl *)(void *,str
uct OCIBind *,unsigned int,unsigned int,void ** ,unsigned int *,unsigned char *,void ** )'
None of the functions with this name in scope match the target type
why,
please help me!Any callback functions have to be C, not C++, linkage. Define your callback function in an extern "C" block.
-
OCI under VC++ compile error
oracle: windows2000
develop tool: vc++
I want to write a class to do insert, update, delete, select, etc.
the connection have successed
but when i do the insert using 'OCIBindDynamic', the following error is out:
error C2664: 'OCIBindDynamic' : cannot convert parameter 4 from 'int (void *,struct OCIBind *,unsigned int,unsigned int,void ** ,unsigned int *,unsigned char *,void ** )' to 'int (__cdecl *)(void *,str
uct OCIBind *,unsigned int,unsigned int,void ** ,unsigned int *,unsigned char *,void ** )'
None of the functions with this name in scope match the target type
why,
please help me!Any callback functions have to be C, not C++, linkage. Define your callback function in an extern "C" block.
-
CMS server stuck at "Starting" status
CMS server stuck at "Starting" status. I cannot stop it and cannot restart it. I even rebooted the NT box several times and it didn't help. Any suggestions? I am running BO XI R2 on Windows NT box.
The message from Events Viewer is: CMS is unstable and will shut down immediately. Reason: Database access error. Reason ORA-24369: required callbacks not registered for one or more bind handles
Edited by: Michael Burgoyne on Jun 4, 2009 5:50 PMHere is the meaning of the error :
ORA-24369:
required callbacks not registered for one or more bind handles
Cause: No callbacks have been registered for one or more of the bind handles which are part of the
RETURNING clause.
Action: The bind handles which are to receive data in a DML statememt with a RETURNING clause must have their mode set as DATA_AT_EXEC and callback functions must be registered for these bind handles using OCIBindDynamic.
It sounds to me that when DB was moved from one server to another CMS DB was either corrupted or not migrated properly or new DB has different settings compared to original.
This is definately on the DB side.
How exactly this move was accomplished ?
How was R2 system repointed to new DB location ?
Do you still have original "pre-move" CMS DB ?
Maybe you are looking for
-
Dear Friends, Please provide the solution for the following scenario: In the first view(xml) I have a table with the fields QuotationNo,plant name, material no...etc, where I am displaying the data fetched using Odata model. The table is enable with
-
Nokia 6233 v05.10 odd behaviour
Hello! After thoroughly searching not only this board but the entire Internet, I found no answer to my question so I decided to register and ASK. I need to know if any of you owners of a Nokia 6233 observed this odd behaviour of your phone - so pleas
-
OS X Recovery Disk Assistant v1.0 to reinstall OS X Mountain lion
I have used the OS X Recovery Disk Assistant v1.0 to reinstall OS X Mountain lion on my Imac and i have used an external hard drive, but while rebooting, i didn't click on the recovery HD and now the external hard drive isn't visible. Can anyone help
-
What is the maximum size of a jpg that can be imported into iPhoto?
what is the maximum size of a jpg that can be imported into iPhoto
-
How can i use Itunes from an external drive
How can I install iTunes on to an external drive an use as my master librarian for music and movies, it must pretty simple, thanks guys!