Behavior of array insert
Quick question: Does the array insert method send the SQL string once or once for each bind? i.e could the sql text size lead to network problems?
Are you referring to Array Binding, or passing an Associative Array? Actually, it doesnt matter, the sql statement gets sent once in both cases. If you've messed around with SQLNet tracing, you can use it to see the actuall communication with the db to confirm that.
I'm not too sure what you mean by "could the sql text size lead to network problems".
Hope it helps,
Greg
Similar Messages
-
OCIBindArrayOfStruct not called, but array insert successed
according to Oracle document, the OCIBindArrayOfStruct must be called for array insert, but I observed a stranger behavior that I bind the address of array through OCIBindByPos and didn't call OCIBindArrayOfStruct, and the call OCIStmtExecute, give iters the number of element of array. all data in array are insert succeeded, so I am wonder what will happen if OCIBindArrayOfStruct is not called? and why even the function is not called, array insert still succeeded? It seems OCI's behavior is same as OCIBindArrayOfStruct if iters great than 1.@
#include "stdafx.h"
#include "oci.h"
void PrintError(OCIError *pError);
int _tmain(int argc, _TCHAR* argv[])
char szName[20] = {0};
char szUID[20] = {0};
char szPWD[20] = {0};
OCIEnv *pEnv = NULL;
OCIError *pErr = NULL;
OCIServer *pServer = NULL;
OCISvcCtx *pSvcCtx = NULL;
OCISession *pSession = NULL;
OCIInitialize((ub4)OCI_THREADED | OCI_OBJECT, 0, 0, 0, NULL);
::OCIEnvInit(&pEnv, OCI_DEFAULT, 0, NULL);
sword wStatus = ::OCIHandleAlloc(pEnv, (void**)&pErr, OCI_HTYPE_ERROR, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Failed allocate Error handle";
return 0;
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pServer, OCI_HTYPE_SERVER, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Failed allocate Server handle.";
return 0;
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pSvcCtx, OCI_HTYPE_SVCCTX, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Failed allocate service context handle.";
return 0;
std::cout << "Please enter the TNS name:";
std::cin >> szName;
std::cout << "Please enter user name:";
std::cin >> szUID;
std::cout << "Please enter password:";
std::cin >> szPWD;
wStatus = ::OCIServerAttach(pServer, pErr, (OraText*)szName, strlen(szName), OCI_DEFAULT);
if (wStatus == OCI_ERROR)
std::cout << "Unable to attach to a server.";
return 0;
OCIAttrSet(pSvcCtx, OCI_HTYPE_SVCCTX, pServer, 0, OCI_ATTR_SERVER, pErr);
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pSession, OCI_HTYPE_SESSION, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Unable to allocate a session handle.";
return 0;
OCIAttrSet(pSession, OCI_HTYPE_SESSION, (void*)szUID, strlen(szUID), OCI_ATTR_USERNAME, pErr);
OCIAttrSet(pSession, OCI_HTYPE_SESSION, (void*)szPWD, strlen(szPWD), OCI_ATTR_PASSWORD, pErr);
wStatus = OCISessionBegin(pSvcCtx, pErr, pSession, OCI_CRED_RDBMS, OCI_DEFAULT);
if (wStatus == OCI_ERROR)
std::cout << "Unable to begin a session.";
return 0;
OCIAttrSet(pSvcCtx, OCI_HTYPE_SVCCTX, pSession, 0, OCI_ATTR_SESSION, pErr);
std::cout << "Connected.";
OCIStmt *pStmt;
OCIBind *pBind;
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pStmt, OCI_HTYPE_STMT, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "failed allocate statement handle." << std::endl;
return 0;
OraText *lpSQL = (OraText*) "Insert into test (prop, value) values(:p, :v)";
wStatus = ::OCIStmtPrepare(pStmt, pErr, lpSQL, strlen((char*)lpSQL), OCI_NTV_SYNTAX, OCI_DEFAULT);
if (wStatus != OCI_SUCCESS)
PrintError(pErr);
int nProp[5] = {1, 2, 3, 4, 5};
char szValue[5][20];
strcpy_s(szValue[0], _countof(szValue), "V1");
strcpy_s(szValue[1], _countof(szValue), "V2");
strcpy_s(szValue[2], _countof(szValue), "V3");
strcpy_s(szValue[3], _countof(szValue), "V4");
strcpy_s(szValue[4], _countof(szValue), "V5");
wStatus = ::OCIBindByName(pStmt, &pBind, pErr, (OraText*)":p", 2, nProp, sizeof(int), SQLT_INT, NULL, NULL, NULL, NULL, NULL, OCI_DEFAULT);
wStatus = ::OCIBindByName(pStmt, &pBind, pErr, (OraText*)":v", 2, szValue, sizeof(szValue[0]), SQLT_STR, NULL, NULL, NULL, NULL, NULL, OCI_DEFAULT);
wStatus = ::OCIStmtExecute(pSvcCtx, pStmt, pErr, 5, 0, NULL, NULL, OCI_COMMIT_ON_SUCCESS);
if (wStatus != OCI_SUCCESS)
PrintError(pErr);
::OCISessionEnd(pSvcCtx, pErr, pSession, OCI_DEFAULT);
::OCIServerDetach(pServer, pErr, OCI_DEFAULT);
return 0;
void PrintError(OCIError *pError)
UCHAR szMessage[1024];
memset(szMessage,0,1024);
sb4 ErrorCode;
(void) OCIErrorGet((dvoid *)pError, (ub4) 1, (text *) NULL, &ErrorCode, szMessage, (ub4) sizeof(szMessage), OCI_HTYPE_ERROR);
std::cout << "Error:" << szMessage << std::endl;according to Oracle document, the OCIBindArrayOfStruct must be called for array insert, but I observed a stranger behavior that I bind the address of array through OCIBindByPos and didn't call OCIBindArrayOfStruct, and the call OCIStmtExecute, give iters the number of element of array. all data in array are insert succeeded, so I am wonder what will happen if OCIBindArrayOfStruct is not called? and why even the function is not called, array insert still succeeded? It seems OCI's behavior is same as OCIBindArrayOfStruct if iters great than 1.@
#include "stdafx.h"
#include "oci.h"
void PrintError(OCIError *pError);
int _tmain(int argc, _TCHAR* argv[])
char szName[20] = {0};
char szUID[20] = {0};
char szPWD[20] = {0};
OCIEnv *pEnv = NULL;
OCIError *pErr = NULL;
OCIServer *pServer = NULL;
OCISvcCtx *pSvcCtx = NULL;
OCISession *pSession = NULL;
OCIInitialize((ub4)OCI_THREADED | OCI_OBJECT, 0, 0, 0, NULL);
::OCIEnvInit(&pEnv, OCI_DEFAULT, 0, NULL);
sword wStatus = ::OCIHandleAlloc(pEnv, (void**)&pErr, OCI_HTYPE_ERROR, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Failed allocate Error handle";
return 0;
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pServer, OCI_HTYPE_SERVER, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Failed allocate Server handle.";
return 0;
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pSvcCtx, OCI_HTYPE_SVCCTX, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Failed allocate service context handle.";
return 0;
std::cout << "Please enter the TNS name:";
std::cin >> szName;
std::cout << "Please enter user name:";
std::cin >> szUID;
std::cout << "Please enter password:";
std::cin >> szPWD;
wStatus = ::OCIServerAttach(pServer, pErr, (OraText*)szName, strlen(szName), OCI_DEFAULT);
if (wStatus == OCI_ERROR)
std::cout << "Unable to attach to a server.";
return 0;
OCIAttrSet(pSvcCtx, OCI_HTYPE_SVCCTX, pServer, 0, OCI_ATTR_SERVER, pErr);
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pSession, OCI_HTYPE_SESSION, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "Unable to allocate a session handle.";
return 0;
OCIAttrSet(pSession, OCI_HTYPE_SESSION, (void*)szUID, strlen(szUID), OCI_ATTR_USERNAME, pErr);
OCIAttrSet(pSession, OCI_HTYPE_SESSION, (void*)szPWD, strlen(szPWD), OCI_ATTR_PASSWORD, pErr);
wStatus = OCISessionBegin(pSvcCtx, pErr, pSession, OCI_CRED_RDBMS, OCI_DEFAULT);
if (wStatus == OCI_ERROR)
std::cout << "Unable to begin a session.";
return 0;
OCIAttrSet(pSvcCtx, OCI_HTYPE_SVCCTX, pSession, 0, OCI_ATTR_SESSION, pErr);
std::cout << "Connected.";
OCIStmt *pStmt;
OCIBind *pBind;
wStatus = ::OCIHandleAlloc(pEnv, (void**)&pStmt, OCI_HTYPE_STMT, 0, NULL);
if (wStatus == OCI_ERROR)
std::cout << "failed allocate statement handle." << std::endl;
return 0;
OraText *lpSQL = (OraText*) "Insert into test (prop, value) values(:p, :v)";
wStatus = ::OCIStmtPrepare(pStmt, pErr, lpSQL, strlen((char*)lpSQL), OCI_NTV_SYNTAX, OCI_DEFAULT);
if (wStatus != OCI_SUCCESS)
PrintError(pErr);
int nProp[5] = {1, 2, 3, 4, 5};
char szValue[5][20];
strcpy_s(szValue[0], _countof(szValue), "V1");
strcpy_s(szValue[1], _countof(szValue), "V2");
strcpy_s(szValue[2], _countof(szValue), "V3");
strcpy_s(szValue[3], _countof(szValue), "V4");
strcpy_s(szValue[4], _countof(szValue), "V5");
wStatus = ::OCIBindByName(pStmt, &pBind, pErr, (OraText*)":p", 2, nProp, sizeof(int), SQLT_INT, NULL, NULL, NULL, NULL, NULL, OCI_DEFAULT);
wStatus = ::OCIBindByName(pStmt, &pBind, pErr, (OraText*)":v", 2, szValue, sizeof(szValue[0]), SQLT_STR, NULL, NULL, NULL, NULL, NULL, OCI_DEFAULT);
wStatus = ::OCIStmtExecute(pSvcCtx, pStmt, pErr, 5, 0, NULL, NULL, OCI_COMMIT_ON_SUCCESS);
if (wStatus != OCI_SUCCESS)
PrintError(pErr);
::OCISessionEnd(pSvcCtx, pErr, pSession, OCI_DEFAULT);
::OCIServerDetach(pServer, pErr, OCI_DEFAULT);
return 0;
void PrintError(OCIError *pError)
UCHAR szMessage[1024];
memset(szMessage,0,1024);
sb4 ErrorCode;
(void) OCIErrorGet((dvoid *)pError, (ub4) 1, (text *) NULL, &ErrorCode, szMessage, (ub4) sizeof(szMessage), OCI_HTYPE_ERROR);
std::cout << "Error:" << szMessage << std::endl; -
The ABAP/4 Open SQL array insert results in duplicate database records
Hi,
Iam getting following error :
The ABAP/4 Open SQL array insert results in duplicate database records.
Error in ABAP application program.
The current ABAP program "SAPLV60U" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
" Information on where terminated
The termination occurred in the ABAP program "SAPLV60U" in "VBUK_BEARBEITEN".
The main program was "SAPMSSY4 ".
The termination occurred in line 503 of the source code of the (Include)
program "LV60UF0V"
of the source code of program "LV60UF0V" (when calling the editor 5030).
Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
the
procedure "VBUK_BEARBEITEN" "(FORM)" but was not handled locally, not declared
in the
RAISING clause of the procedure.
The procedure is in the program "SAPLV60U ". Its source code starts in line 469
of the (Include) program "LV60UF0V "."
Please assist how to proceed further ..
Many thanks
Mujeeb.Sorry, THe correct note is 402221.
Description from the note
<< Please do not post SAP notes - they are copyrighed material >>
Edited by: Rob Burbank on Feb 22, 2009 3:46 PM -
ABAP/4 Open SQL array insert results in duplicate databaserecordsfor pk13
Hi Experts, when I am working with pk13n tranaction iam getting an error message stating that update was terminated by user. when i am checking with st22 it gives the following message. please give the solution , iam sending the code as well.
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "SAVE_DATA" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
If you use an ABAP/4 Open SQL array insert to insert a record in
the database and that record already exists with the same key,
this results in a termination.
(With an ABAP/4 Open SQL single record insert in the same error
situation, processing does not terminate, but SY-SUBRC is set to 4.) please find the below code please give the solution for this error message.
1 *eject
2 *----
3 * Verbuchen der Daten *
4 *----
5 FORM SAVE_DATA.
6
7 DATA: lf_menge LIKE ekpo-menge VALUE 0, "717464
8 lf_netwr LIKE ekpo-netwr VALUE 0.
9
10 * Einteilungen löschen --> Array Delete aus Tabelle DEKET
11 DESCRIBE TABLE DEKET LINES SY-TFILL.
12 IF SY-TFILL GT 0.
13 DELETE EKET FROM TABLE DEKET.
14 IF SY-SUBRC NE 0.
15 MESSAGE A865.
16 ENDIF.
17 EKET_DELETE = EKET_DELETE + SY-DBCNT.
18 REFRESH: DEKET.
19 CLEAR : DEKET.
20 ENDIF.
21
22 * Einteilungen hinzufügen --> Array Insert aus Tabelle IEKET
23 DESCRIBE TABLE IEKET LINES SY-TFILL.
24 IF SY-TFILL GT 0.
>> INSERT EKET FROM TABLE IEKET.
26 IF SY-SUBRC NE 0.
27 MESSAGE A864.
28 ENDIF.
29 EKET_INSERT = EKET_INSERT + SY-DBCNT.
30 REFRESH: IEKET.
31 CLEAR : IEKET.
32 ENDIF.
33
34 * Check whether the qty in EKPO-MENGE is correct: note 717464
35 SELECT SUM( menge ) FROM eket INTO lf_menge
36 WHERE ebeln = ekpo-ebeln
37 AND ebelp = ekpo-ebelp.
38 IF sy-subrc = 0 AND ekpo-menge <> lf_menge.
39 IF ekpo-ktmng <> 0.
40 refe1 = ekpo-zwert * lf_menge / ekpo-ktmng.
41 ELSE.
42 refe1 = ekpo-zwert * lf_menge / 1000.
43 ENDIF.
44 IF refe1 > maxwert.Hi,
Well I don't know why you have duplicates, this is a functionnal issue. But you get the dump due the the message number 864 that triggers the abend... Changing the message type to 'E', 'S' or 'I' will prevent the dump but I guess this message has a good reason to be
Kr,
Manu. -
The size limit of the OCI LOB Array Insert is 64K for one field?
I have a table with 4 field, and one is BLOB field. I want to insert 16 rows in one OCIStmtExecute. I know I can specify the iter parameter with 16 to execute sql 16 times.
I found example in "Application Developer's Guide - Large Objects" in page "Data Interface for Persistent LOBs 13-17", there is a example function called "array_insert". It shows the usage of OCIBindArrayOfStruct, but can only insert LOB with same size, the LOB field of each row filled with the same size data.
But I have to insert LOB with different size, for example 8K for row 1, and 16K for row 2, 128K for row 3. Than I find the alenp parameter of OCIBindByName/OCIBindByPos. It is "pointer to array of actual lengths of array elements."(OCI document). So I think I find the solution for my problem. But the type of alenp parameter is ub2*, is it means I can only insert 64K data for each row in my array insert? It is too small, I hope I can array insert BLOB with 16M each row.
Or there is any other solution for my problem? I look forward to it for a long time! thanks every one!It is called Data Interface to work with LOB datatypes by APIs designed for use with legacy datatypes. I can specify SQLT_BIN to bind memory binary data to BLOB column, and INSERT or UPDATE directly. It can be without LOB locator and save round-trip to the server. This is very fit my needs, because I have to insert very much BLOBs to server as soon as possible.
I have make a test program, and multi-row with different size blob( less than 65536 bytes) can be insert at one time, without locators. Multi-row wiht same size blob( more than 64K) also can be insert at one time--the alenp parameter is not used. I only can not insert multi-row with different size blob( more than 64k) because the type of alenp is ub2*.
thank you for your reply! -
The ABAP/4 Open SQL array insert results in duplicate Record in database
Hi All,
I am trying to transfer 4 plants from R/3 to APO. The IM contains only these 4 plants. However a queue gets generated in APO saying 'The ABAP/4 Open SQL array insert results in duplicate record in database'. I checked for table /SAPAPO/LOC, /SAPAPO/LOCMAP & /SAPAPO/LOCT for duplicate entry but the entry is not found.
Can anybody guide me how to resolve this issue?
Thanks in advance
Sandeep PatilHi Sandeep,
Now try to delete ur location before activating the IM again.
Use the program /SAPAPO/DELETE_LOCATIONS to delete locations.
Note :
1. Set the deletion flag (in /SAPAPO/LOC : Location -> Deletion Flag)
2. Remove all the dependencies (like transportation lane, Model ........ )
Check now and let me know.
Regards,
Siva.
null -
Does JDBC/OCI8 support array inserts? I'm familiar with the C/C++ array inserts, but I haven't found anything on array inserting using JDBC/OCI8.
Array processing gives an application a real performance boost and I was hoping to use it in Java.Hi ,
I am facing the same problem with
Oracle 8.1.5 on Windows NT.
Driver : 8.1.6 JDBC OCI Driver
JDK 1.2.2
Any workaround / patch to solve this problem please ?
Thanks,
Shubhada -
RE: (forte-users) SQL Array Insert
Unfortunately that carries a tremendous overhead. Each request is a seperate
message and forte generates alot of behind the scenes prepares for the sql.
---------------------- Forwarded by Amos G. Radford on 10/27/2000 02:34 PM
"Amin, Kamran" <kamran.aminlendware.com> on 10/27/2000 02:33:07 PM
To: Amos G. RadfordBankofAmerica
cc:
Class: Internal Use Only
Subject: RE: (forte-users) SQL Array Insert
User a for loop and call update for each row in the array.
For Loop
Update
set
1=test[1]
end for
ka
-----Original Message-----
From: Amos.G.Radfordbankofamerica.com
[mailto:Amos.G.Radfordbankofamerica.com]
Sent: Friday, October 27, 2000 12:07 PM
To: forte-userslists.xpedior.com
Subject: (forte-users) SQL Array Insert
I have run into a strange problem that I never really run into
before. If I want to save an array of items into a table in TOOL
SQL, how can I do it if the column names in the table are different
than the column names in the class. In the past we always had
the luxury of the column names being the same.
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.comMadhu,
Do the following:
1. create prepare statement
e.g
stmHnd : DBStatementHandle;
inputData : DBDataset = new;
stmType : integer;
stmHnd = DBSesObj.prepare('insert into
table_name myCOl1, myCol2, myCol3
values(:myCol1Value, :myCol2Value, :myCol3Value)',
inputData,stmType);
2. Populate the input DBDataset.
e.g
// assign the maximum value
inputData = myArrObj.items;
// assign the values
for i in 1 to myArrObj.items do
inputdata.currentRow = i;
inputdata.setvalue(':myCol1Value',
myArrObj.attr1);
inputdata.setvalue(':myCol2Value',
myArrObj[i].attr2);
inputdata.setvalue(':myCol3Value',
myArrObj[i].attr3);
end for;
3. execute the statement:
e.g .
DBSesObj.execute(stmHnd, inputData);
4. release the handle
DBSesObj.RemoveStatement(stmHnd);
Hope this helps,
Babu
--- "Epari, Madhusudhan" <meparioxhp.com> wrote:
Babu,
I'm not clear on how dynamic sql statement would
access the database only
one time for inserting an array of records in to the
table. Could you tell
how's it done?
thanks in advance,
Madhu
-----Original Message-----
From: Babu Raj [mailto:ibcsmartboyyahoo.com]
Sent: Friday, October 27, 2000 8:02 PM
To: Amos.G.Radfordbankofamerica.com;
forte-userslists.xpedior.com
Subject: RE: (forte-users) SQL Array Insert
Amos,
Why don't you use, Dyanmic SQL statement,
where
you need to prepare only one SQL Statement, and
populate input place holder, which is much simpler
and
you need to access the database only one time(which
is
efficient operation). This is useful, especially,
when
you want to update. But for your inforamtion, Forte
internally inserts, one by one row, even if u call
Static SQl statement, with array of record. Os its
advisable to use Dyanmic SQL statement.
Hope this helps,
Babu
--- Amos.G.Radfordbankofamerica.com wrote:
Unfortunately that carries a tremendous overhead.
Each request is a seperate
message and forte generates alot of behind the
scenes prepares for the sql.
---------------------- Forwarded by Amos G.Radford
on 10/27/2000 02:34 PM
"Amin, Kamran" <kamran.aminlendware.com> on
10/27/2000 02:33:07 PM
To: Amos G. RadfordBankofAmerica
cc:
Class: Internal Use Only
Subject: RE: (forte-users) SQL Array Insert
User a for loop and call update for each row inthe
array.
For Loop
Update
set
1=test[1]
end for
ka
-----Original Message-----
From: Amos.G.Radfordbankofamerica.com
[mailto:Amos.G.Radfordbankofamerica.com]
Sent: Friday, October 27, 2000 12:07 PM
To: forte-userslists.xpedior.com
Subject: (forte-users) SQL Array Insert
I have run into a strange problem that I never
really run into
before. If I want to save an array of items intoa
table in TOOL
SQL, how can I do it if the column names in the
table are different
than the column names in the class. In the pastwe
always had
the luxury of the column names being the same.
For the archives, go to:
http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To
unsubscribe, send in a new
email the word: 'Unsubscribe' to:
forte-users-requestlists.xpedior.com
For the archives, go to:
http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To
unsubscribe, send in a new
email the word: 'Unsubscribe' to:
forte-users-requestlists.xpedior.com
For the archives, go to:
http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To
unsubscribe, send in a new
email the word: 'Unsubscribe' to:forte-users-requestlists.xpedior.com -
The ABAP/4 Open SQL array insert results in duplic
Hi All,
During monitoring of our SAP SRM system in SM58 transaction we have received the below error. Please advise on this.
The ABAP/4 Open SQL array insert results in duplic
SM58 for Wf-BATCH user
SRM/MM: FM SPPF_PROCESS
thanks and regards
mohammedWhat action did you performed?
-
He ABAP/4 Open SQL array insert results in duplicate database records
Dear Gurus,
II am getting a dump when I run MD02/ MD03. (t- code to run MRP)
Below is the message system is showing:
Please help
Thanks in Advance
Best Regards
Adhish
Short text
The ABAP/4 Open SQL array insert results in duplicate database records.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLM61U" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "INSERT_MDSBI_IN_MDSB" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
If you use an ABAP/4 Open SQL array insert to insert a record in
the database and that record already exists with the same key,
this results in a termination.
(With an ABAP/4 Open SQL single record insert in the same error
situation, processing does not terminate, but SY-SUBRC is set to 4.)
1 *----
2 * ARRAY-INSERT auf MDSB
3 *----
4 FORM INSERT_MDSBI_IN_MDSB.
INSERT MDSB6 FROM TABLE MDSBI.
7 ADD SY-DBCNT TO STATS-RESBI. "statistics
8 ENDFORM.Hi,
There must be inconsistency in the number range. This happens when the current number in the number range for dependent requirements is lower than the highest number in the database table of the dependent requirements RESB.
Please check the current number in transaction OMI2. Here in the interval you can see the current number. Then please check the highest number in table RESB. If the current number in OMI2 is lower than the highest number in table RESB then this should be the reason for the dump.
Check and revert. If that's not the case we'll look into other possibilities.
In mean time check for SAP Note 138108. -
Array Inserts with Java?
Hey,
Just doing some forward thinking for a project and ran into a
question that I can't seem to find a straight forward answer to.
I'll be importing data from a flat file structure and want to
make it as fast as possible to process as it may be a large set
of records.
Can Java (JDev 2.0) do array inserts. I'd like to achieve
something like PRO*C in that I want to be able to pass an array
of records to insert, batching them so that it's not a single
network (or database) hit per record inserted.
Any help appriciated!
Doug
nullDoug,
I think any kind of mass inserting is not going to be optimal
over JDBC.
I am pretty sure the batch update just saves you some network
roundtrips. I believe each insert/update would still be a
separate transaction once on the server side, if nothing else for
the purposes of rollbacks, etc.
-L
Doug Gault (guest) wrote:
: Guys,
: Thanks for the quick response.
: I had run into the Batch Update facility but on my initial
: reading it seemed to be more about compacting network traffic
: rather than enhancing mass insert performance.. Did I get the
: wrong end of the stick here?
: What (roughly) happens to the 'Batched' set of transactions
once
: the Database gets it. Is the set processed as a single
: transaction (all or nothing)?
: I'll re-read this section, and take a look at the Tech net
: examples
: Thanks
: Doug
: JDeveloper Team (guest) wrote:
: : Doug,
: : I ran into problems with trying to pass arrays. Namely, with
: : stored procedures, JDBC treats an array argument as an
attempt
: to
: : declare an IN/OUT type parameter, and only allows that array
to
: : contain one object.
: : The JDBC doc has a section on performance enhancements that
you
: : may want to investigate, specifically the Batch Update
facility
: : described in Chapter 4 in the 'Additional Oracle Extensions'
: : section. You can use this to 'batch up sets of inserts or
: : updates' rather than send them one at a time.
: : Alternately, I recommend you check out the JDBC sample code
: : provided on OTN. They have some better 'real world' examples
: : than the JDBC docs.
: : -L
null -
ABAP/4 Open SQL array insert results in duplicate database records in SM58
Hi Everyone,
I am testing a file to idoc scenario in my Quality system. When I passed the input file, the mapping executed successfully and there are no entries in SMQ2 but still the idoc wasn't created in the ECC system. When I have checked in TRFC, I am getting the error ABAP/4 Open SQL array insert results in duplicate database records for IDOC_INBOUND_AYNCHRONOUS function module. I thought this is a data issue and I have tested with a fresh data which was never used for testing in Quality but even then I am getting the same error.Kindly advise.
Thanks,
Laawanyause FM idoc_status_write_to_database to change the IDoc status from 03 to 30 and then run WE14 or RSEOUT00 to change the status back to 03
resending idoc from status 03 ...is a data duplicatino issue on receiving side...why do u need to do that ?
Use WE19 tcode to debug
In we19
1)U can choose your Idoc number in existing Idoc textbox
2)Press execute
3)u will display ur Idoc struct
4)Dbl click on any field then u can modify its content
5)PressStd Outbound Processing Btn to process modified Idoc
Thats it -
Error: The ABAP/4 Open SQL array insert results in duplic in EWM
Hi Friends,
During outbound process in EWM, my completed EWM delivery gets stuck in SMQ1 with error "The ABAP/4 Open SQL array insert results in duplic". I performed following checks and found all the ok. Please help me with your insights.
- Checked the Master data Products, Business Partners,are CIFed properly. Yes they are done properly.
- Checked if inbound is stuck in same way. But its not.
- Checked if there is any enhancement stopping in ECC. There is some enhancement in Document_save in ECC outbound delivery which I got it commented. Still the problem is same.
Please suggest what could be the root cause.
Thanks
TrivediHi Rushikesh,
I checked all Number ranges (O/D in EWM and ECC, HU and Batches). All are ok. I tried taking help of ABAPer to see if any Run time errors occuring but no use.
Regards,
Trivedi -
Array Insert/Update/Select in JDBC
I've been using array processing in ODBC, OCI, and Pro*C for years and desperately need to do so in JDBC. I've thus far been unsuccessful and am beginning to doubt that it's supported which to me is unfathomable. I've likewise found many like inquiries on the net - none of which were addressed. There have been many respondants who don't undertstand what array processing is and mistake it for batch SQL statements. They are not the same. Batched SQL statements are seperate statements which are executed in a single call to the database engine. What I'm taking about is using a prepared statement and binding primitive arrays to the statement. A single statement is executed and the contents of the arrays passed to the database. I've conducted tests years ago and array insert/update is many times faster than batch statements. Does anyone know whether or not JDBC supports array processing? If anyone's interested, I can provide snippets via email which illustrate how this is done in ODBC and other API's.
Thanks.You referred me to
http://java.sun.com/products/jdbc/download.html. The
only reference I found to arrays were SQL Arrays - not
what I'm talking about. See prior C/ODBC snippet. Do
you know how to do this in JDBC?You are talking about passing an array as a single parameter to and from the underlying database correct? (And that has nothing to do with batch processing.)
If so in section 16.4 "Array Object"..... looking at that section gives the following reference....
The Array object returned to an application by the ResultSet.getArray and
CallableStatement.getArray methods is a logical pointer to the SQL ARRAY
value in the database; it does not contain the contents of the SQL ARRAY value.
The above has nothing to do with batch processing (although presumably one could use it in a batch process but then one can use String as well.)
Of course perhaps there is something in there that says that only applies to batch processing. If so could you please point out the section and quote the text. -
Pro*C: host array insert using VARCHAR
I followed the sample program sqlvcp.pc (explained in the ORACLE docu for Pro*C) to select severel rows from the database into an host array of varchar. This needs only one FETCH in program and works very well.
I tried to use the same method to insert a host array of varchar into the database.
BUT unfortunately only one row is inserted and then I get the error -01458.
I checked data in my host array (allocated with malloc) using a debugger and I can't find an error.
Is it possible to use this method to insert several rows out of a host array of varchar into the database using only one insert statement?
If yes, for what do I have to take care of?
Or do I have to use a loop with one insert for every row. This would be much slower!
Thanks for Help.Hi prajithparan,
Thanks for the response. I already looked at the link and a few other links in this forum that are related to array inserts/updates. However, I could not find answers to my specific questions. I am specifically concerned with the setup of parameters to the API calls (OCIBindByName and OCIBindArrayOfStruct) that fully reflects the two-dimensional nature of the array of structs that I am trying to insert.
Moreover, I need to set the data type of the columns to be inserted as SQLT_STR. I think this data type requires the programmer to supply the length of the null terminated C strings as well. If we are inserting just one column, we can provide the length of each of the strings to be inserted into a VARCHAR2 column as part of a OCIBind call, for each of those columns.
Since in an array insert, we are supplying multiple rows at the same time, how do we supply the lengths of strings to be inserted ? Should it be some form of two-dimensional array ?
I could not get clear answers to these questions from either the Oracle documentation or the links on this forum. May be the answers are there and I am just missing them ?
Maybe you are looking for
-
Okay so when I try to download apps on my phone a totally different Apple ID that I've never used before popped up. I've already tried settings under apps/iTunes and signed into my own apple account. But even doing so my apple Id won't show up
-
How does one print a weekly calendar of appointments along with their notes?
-
I am looking for an accessory that has the Ipod port on one end and an HDMI port on the other end, so I can watch the HD videos I record on the 4S directly on my HD TV.
-
Premiere Elements 11 - Red Footage
What is the best way to get Red (R3d) footage into Elements. Originally when I bought it I thought I was getting the Premiere with the direct import, but of course that was only for Premiere Pro CS5.5 or 6. But now just wondering what anyone has foun
-
Number Range for MIGO (GR)
Hi, I am in a Pharma Company & I have a problem about number range at the time of GR.i.e i required diffrent Number range for diffrent material types.How do the setting in SAP(ECC 6.0) - SPRO.