Data not getting inserted into oracle with theAutoCommitEnabled not checked
Hello Experts
I have a proxy to JDBC scenario.I have 3 SQL statements and the Format is
<DeleteStatement>
<InsertStatement>
<CallStoredProcStatement>.
While excecuting with the AutoCommitEnabled box checked, the insert statement is excecuting and the data is getting updated in the oracle database..But the CallStoredProcStatement is not excecuting.
If the AutoCommitEnabled box not checked,the data is not getting updated in the database .but in RWB log all the SQL statements are getting executed successfully.
Are there any other configurations still to be made in the JDBC adapter.
Hi,
Why you not using single SP to handle all the queries?
BTW, have you used the parameter "logSQLStatement = true" in JDBC receiver channel? It will show in audit log what query is being executed.
Regards,
Neetesh
Similar Messages
-
Data not getting inserted into table Hxt_Add_Assign_Info_F
Hi,
Can any one tell me as to when data is inserted into the table Hxt_Add_Assign_Info_F.
Lately this table has not been getting updated.
Thanks
ZickyHi Sharath,
Thanks alot for the info, it seems that data had not been entered for certain employees in that form and hence the problem.
Even then, I guess it will be a day or 2 before they will be able to see their in/out timings.
Regards
Zicky -
Incorrect data value when insert into oracle table
Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that, the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.
user11432758 wrote:
Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that, the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.
implicit datatype conversion to NUMBER can result in leading zero to be eliminated.
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002 -
Record not getting inserted into R/3 table.
Hi Experts,
I am trying to save some information in R/3 using BAPI. I have written codes like as shown below:
Code in View
public void onActionInsertRecord(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionInsertRecord(ServerEvent)
try { wdThis.wdGetTimesheetCompController().executeBapi_Catimesheetmgr_Insert_Input();
wdThis.wdGetTimesheetCompController().executeBapi_Transaction_Commit_Input();
} catch (Exception ex)
{wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
//@@end
Code in Component Controller
public void executeBapi_Catimesheetmgr_Insert_Input( )
//@@begin executeBapi_Catimesheetmgr_Insert_Input()
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{ Bapicats1 xx = new Bapicats1();
xx.setWbs_Element(wdContext.currentWorklistElement().getRec_Wbs());
xx.setEmployeenumber(wdContext.currentZbapi_Cat_Stech00_Getdetail_InputElement().getEmployeenumber());
xx.setCatshours(new BigDecimal ("1"));
xx.setWorkdate(wdContext.currentOutputElement().getDate_From());
wdContext.currentBapi_Catimesheetmgr_Insert_InputElement().setProfile(wdContext.currentZbapi_Cat_Stech00_Getdetail_InputElement().getProfile());
wdContext.currentBapi_Catimesheetmgr_Insert_InputElement().modelObject().execute();
wdContext.nodeOutputnew().invalidate();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//@@end
My records are not getting saved in R/3 tables. Can you please let me know what is going wrong here. The BAPI input parameters values are correctly getting populated in Component Controller.
I have also created error message table in View. This error message table is mapped to output of Bapi_Catimesheetmgr_Insert. This table is not getting populated.
Due to this reason, I believe that the values of input parameters of BAPI are not getting passed to R/3. However, I am not sure where the problem lies. Can you please help me in resolving the issue?
Regards,
BrianHi Sumit,
I am not getting any exception. Using SE37, I can save the transaction. Can you please let me know what is going wrong here.
Regards,
Sumit -
.csv file should not get insert sql query with report
Hi Guys,
the below sqlplus code giving both sql query and records report in csv format file. I want only records csv file report.
SET LINESIZE 1000 TRIMSPOOL ON PAGESIZE 0 FEEDBACK OFF
SPOOL c:\oracle\extract\emp.csv
SELECT empno || ',' || ename || ',' || job || ',' || mgr || ',' || TO_CHAR(hiredate,'DD-MON-YYYY') AS hiredate || ',' || sal || ',' || comm || ',' || deptno
FROM emp ORDER BY ename;
SPOOL OFF
SET PAGESIZE 14
can any one suggest me on this.
Thanks in advance!
Regards,
KLRYou will have to use UNION ALL:
SQL> SET LINESIZE 1000 TRIMSPOOL ON PAGESIZE 0 FEEDBACK OFF
SQL> WITH t AS (
2 SELECT 'empno,ename,job,mgr,hiredate,sal,comm,deptno' str,
3 null ename
4 FROM dual
5 UNION ALL
6 SELECT empno || ',' || ename || ',' || job || ',' || mgr || ',' || TO_CHAR(hiredate,'DD-MON-YYYY') || ',' || sal || ',' || comm || ',' || deptno str,
7 ename
8 FROM emp
9 )
10 SELECT str
11 FROM t
12 ORDER BY ename NULLS FIRST;
empno,ename,job,mgr,hiredate,sal,comm,deptno
7876,ADAMS,CLERK,7788,23-MAY-1987,1100,,20
7499,ALLEN,SALESMAN,7698,20-FEB-1981,1600,300,30
7698,BLAKE,MANAGER,7839,01-MAY-1981,2850,,30
7782,CLARK,MANAGER,7839,09-JUN-1981,2450,,10
7902,FORD,ANALYST,7566,03-DEC-1981,3000,,20
7900,JAMES,CLERK,7698,03-DEC-1981,950,,30
7566,JONES,MANAGER,7839,02-APR-1981,2975,,20
7839,KING,PRESIDENT,,17-NOV-1981,5000,,10
7654,MARTIN,SALESMAN,7698,28-SEP-1981,1250,1400,30
7934,MILLER,CLERK,7782,23-JAN-1982,1300,,10
7788,SCOTT,ANALYST,7566,19-APR-1987,3000,,20
7369,SMITH,CLERK,7902,17-DEC-1980,800,,20
7844,TURNER,SALESMAN,7698,08-SEP-1981,1500,0,30
7521,WARD,SALESMAN,7698,22-FEB-1981,1250,500,30
SQL>
SY. -
Bulk insert into oracle using ssis
Hi ,
Can someone please suggest me the way to Bulk insert data into oracle database? I'm using oledb which doesnt support bulk insert into oracle.
Pls note I cant use Oracle ATTUnity as it requires enterprise edition but i have only Standard edition and hence that option is ruled out.
Is there any other way that I can accompolish BULK insert?
Please help me out.
Thanks,
PrabhuHi Prabhu,
I am very late to help you solve the query but following is the solution to 'Bulk Insert into Oracle' that worked for me.
To use below code for SSIS 2008 R2 in a
Script Task component you would need following API references.
Prerequisites:
1. C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.DTSRuntimeWrap.dll
2. Install "Oracle Data Provider For .NET 11.2.0.1.0" and add a reference to
Oracle.DataAccess.dll.
Microsoft SQL Server Integration Services Script Task
Write scripts using Microsoft Visual C# 2008.
The ScriptMain is the entry point class of the script.
* Description : SQL to Oracle Bulk Copy/Insert
* Created By : Mitulkumar Brahmbhatt
* Created Date: 08/14/2014
* Modified Date Modified By Description
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using Oracle.DataAccess.Client;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Data.OleDb;
namespace ST_6e18a76102dd4312868504c4ef95279d.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
public void Main()
ConnectionManager cm;
IDTSConnectionManagerDatabaseParameters100 cmParams;
OleDbConnection oledbConn;
DataSet ds = new DataSet();
string sql;
try
/********** Pull Sql Source Data into a Dataset *************/
cm = Dts.Connections["SRC_CONN"];
cmParams = cm.InnerObject as IDTSConnectionManagerDatabaseParameters100;
oledbConn = (OleDbConnection)cmParams.GetConnectionForSchema() as OleDbConnection;
sql = @"Select * from [sourcetblname]'';
OleDbCommand sqlComm = new OleDbCommand(sql, oledbConn);
OleDbDataAdapter da = new OleDbDataAdapter(sqlComm);
da.Fill(ds);
cm.ReleaseConnection(oledbConn);
/***************** Bulk Insert to Oracle *********************/
cm = Dts.Connections["DEST_CONN"];
cmParams = cm.InnerObject as IDTSConnectionManagerDatabaseParameters100;
string connStr = ((OleDbConnection)cmParams.GetConnectionForSchema() as OleDbConnection).ConnectionString;
cm.ReleaseConnection(oledbConn);
sql = "destinationtblname";
using (OracleBulkCopy bulkCopy = new OracleBulkCopy(connStr.Replace("Provider=OraOLEDB.Oracle.1", "")))
bulkCopy.DestinationTableName = sql;
bulkCopy.BatchSize = 50000;
bulkCopy.BulkCopyTimeout = 20000;
bulkCopy.WriteToServer(ds.Tables[0]);
/***************** Return Result - Success *********************/
Dts.TaskResult = (int)ScriptResults.Success;
catch (Exception x)
Dts.Events.FireError(0, "BulkCopyToOracle", x.Message, String.Empty, 0);
Dts.TaskResult = (int)ScriptResults.Failure;
finally
ds.Dispose();
Mitulkumar Brahmbhatt | Please mark the post(s) that answered your question. -
BDC-Not getting inserted when run in 'Display errors- (E)' mode
Hi,
I am doing a BDC for FS00 transaction through Call transaction method. The data is getting inserted into the table when i run the BDC program screen by screen through 'Display all screens - (A)' mode and is not getting inserted into the table when i run the BDC program through 'Display errors- (E)' mode.
What could be the reason for it?If you have defined a non-existing screen or field, and error will rise and the transaction will be stoped....
When your working on 'A' mode, you need to perform an extra "Enter" button press to get rid of that problem....So you better check your Batch catalog and add some "Enter's" when need it -;)
Greetings,
Blag. -
Hi Everyone,
A Very Very Happy, Fun-filled, Awesome New Year to You All.
Now coming to the discussion of my problem in Oracle Forms 6i:
I have created a form in which the data is entered & saved in the database.
CREATE TABLE MATURED_FD_DTL
ACCT_FD_NO VARCHAR2(17 BYTE) NOT NULL,
CUST_CODE NUMBER(9),
FD_AMT NUMBER(15),
FD_INT_BAL NUMBER(15),
TDS NUMBER(15),
CHQ_NO NUMBER(10),
CREATED_DATE DATE,
CREATED_BY VARCHAR2(15 BYTE),
PREV_YR_TDS NUMBER(15),
ADD_FD_AMT NUMBER(15),
DESCRIPTION VARCHAR2(100 BYTE),
P_SAP_CODE NUMBER(10),
P_TYPE VARCHAR2(1 BYTE)
The form looks like below:
ENTER_QUERY EXECUTE_QUERY SAVE CLEAR EXIT
ACCT_FD_NO
CUST_CODE
FD_AMT
FD_INT_BAL
PREV_YR_TDS
TDS
ADD_FD_AMT
P_SAP_CODE
P_TYPE
CHQ_NO
DESCRIPTION
R
W
P
List Item
There are 5 push buttons namely ENTER_QUERY, EXECUTE_QUERY, SAVE, CLEAR, EXIT.
The table above is same as in the form. All the fields are text_item, except the P_TYPE which is a List_Item ( Elements in List Item are R, W & P).
The user will enter the data & save it.
So all this will get updated in the table MATURED_FD_DTL .
I am updating one column in another table named as KEC_FDACCT_MSTR.
and
I want this details to get updated in another table named as KEC_FDACCT_DTL only if the P_TYPE='P'
CREATE TABLE KEC_FDACCT_DTL
FD_SR_NO NUMBER(8) NOT NULL,
FD_DTL_SL_NO NUMBER(5),
ACCT_FD_NO VARCHAR2(17 BYTE) NOT NULL,
FD_AMT NUMBER(15,2),
INT_RATE NUMBER(15,2),
SAP_GLCODE NUMBER(10),
CATOGY_NAME VARCHAR2(30 BYTE),
PROCESS_YR_MON NUMBER(6),
INT_AMT NUMBER(16,2),
QUTERLY_FD_AMT NUMBER(16,2),
ITAX NUMBER(9,2),
MATURITY_DT DATE,
FDR_STAUS VARCHAR2(2 BYTE),
PAY_ACC_CODE VARCHAR2(85 BYTE),
BANK_CODE VARCHAR2(150 BYTE),
NET_AMOUNT_PAYABLE NUMBER,
QUATERLY_PAY_DT DATE,
CHEQUE_ON VARCHAR2(150 BYTE),
CHEQUE_NUMBER VARCHAR2(10 BYTE),
CHEQUE_DATE DATE,
MICR_NUMBER VARCHAR2(10 BYTE),
PAY_TYPE VARCHAR2(3 BYTE),
ADD_INT_AMT NUMBER(16,2),
ADD_QUTERLY_FD_AMT NUMBER(16,2),
ADD_ITAX NUMBER(16,2),
ECS_ADD_INT_AMT NUMBER(16),
ECS_ADD_QUTERLY_FD_AMT NUMBER(16),
ECS_ADD_ITAX NUMBER(16)
So for the push button 'Save' , i have put in the following code in the Trigger : WHEN BUTTON PRESSED,
BEGIN
Commit_form;
UPDATE KEC_FDACCT_MSTR SET PAY_STATUS='P' WHERE ACCT_FD_NO IN (SELECT ACCT_FD_NO FROM MATURED_FD_DTL);
UPDATE MATURED_FD_DTL SET CREATED_DATE=sysdate, CREATED_BY = :GLOBAL.USER_ID WHERE ACCT_FD_NO = :acct_fd_NO;
IF :P_TYPE='P' THEN
INSERT INTO KEC_FDACCT_DTL
SELECT FD_SR_NO, NULL, MATURED_FD_DTL.ACCT_FD_NO, FD_AMT, INT_RATE, P_SAP_CODE,
GROUP_TYPE, (TO_CHAR(SYSDATE, 'YYYYMM'))PROCESS_YR_MON,
FD_INT_BAL, (FD_INT_BAL-MATURED_FD_DTL.TDS)QUTERLY_FD_AMT , MATURED_FD_DTL.TDS,
MATURITY_DATE, P_TYPE, NULL, NULL, (FD_INT_BAL-MATURED_FD_DTL.TDS)NET_AMOUNT_PAYABLE,
NULL, NULL, CHQ_NO, SYSDATE, NULL, 'CHQ', NULL, NULL, NULL, NULL, NULL, NULL
FROM MATURED_FD_DTL, KEC_FDACCT_MSTR
WHERE KEC_FDACCT_MSTR.ACCT_FD_NO=MATURED_FD_DTL.ACCT_FD_NO;
END IF;
COMMIT;
MESSAGE('RECORD HAS BEEN UPDATED AS PAID');
MESSAGE(' ',no_acknowledge);
END;
If P_TYPE='P' , then the data must get saved in KEC_FDACCT_DTL table.
The problem what is happening is,
If i enter the details with all the records as 'P' , the record gets inserted into the table KEC_FDACCT_DTL
If i enter the details with records of 'P' and 'R' , then nothing gets inserted into the table KEC_FDACCT_DTL.
Even the records with 'P' is not getting updated.
I want the records of 'P' , to be inserted into table KEC_FDACCT_DTL, even when multiple records of all types of 'P_Type' (R, w & P) are entered.
So, can you please help me with this.
Thank You.
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
Oracle Forms Builder 6i.Its not working properly.
At Form_level_Trigger: POST_INSERT, I have put in the following code.
IF :P_TYPE='P'THEN
INSERT INTO KEC_FDACCT_DTL
SELECT FD_SR_NO, NULL, MATURED_FD_DTL.ACCT_FD_NO, FD_AMT, INT_RATE, P_SAP_CODE,
GROUP_TYPE, (TO_CHAR(SYSDATE, 'YYYYMM'))PROCESS_YR_MON,
FD_INT_BAL, (FD_INT_BAL-MATURED_FD_DTL.TDS)QUTERLY_FD_AMT , MATURED_FD_DTL.TDS,
MATURITY_DATE, P_TYPE, NULL, NULL, (FD_INT_BAL-MATURED_FD_DTL.TDS)NET_AMOUNT_PAYABLE,
NULL, NULL, CHQ_NO, SYSDATE, NULL, 'CHQ', NULL, NULL, NULL, NULL, NULL, NULL
FROM MATURED_FD_DTL, KEC_FDACCT_MSTR
WHERE KEC_FDACCT_MSTR.ACCT_FD_NO=MATURED_FD_DTL.ACCT_FD_NO;
END IF;
MESSAGE('RECORD HAS BEEN UPDATED AS PAID');
MESSAGE(' ',no_acknowledge);
It worked properly when i executed first time, but second time , in database duplicate values were stored.
Example: First I entered the following in the form & saved it.
ACCT_FD_NO
CUST_CODE
FD_AMT
FD_INT_BAL
PREV_YR_TDS
TDS
ADD_FD_AMT
P_SAP_CODE
P_TYPE
CHQ_NO
DESCRIPTION
250398
52
50000
6000
0
600
0
45415
P
5678
int1
320107
56
100000
22478
3456
2247
0
45215
R
456
320108
87
50000
6500
0
650
0
21545
W
0
In the database, in table KEC_FDACCT_DTL, the ACCT_FD_NO:250398 with P_TYPE='P' record was inserted.
ACCT_FD_NO
P_TYPE
250398
P
But second time, when i entered the following in the form & saved.
ACCT_FD_NO
CUST_CODE
FD_AMT
FD_INT_BAL
PREV_YR_TDS
TDS
ADD_FD_AMT
P_SAP_CODE
P_TYPE
CHQ_NO
DESCRIPTION
260189
82
50000
6000
0
600
0
45415
P
5678
interest567
120011
46
200000
44478
0
4447
0
45215
R
456
30191
86
50000
6500
0
650
0
21545
W
56
In the database, in the table KEC_FDACCT_DTL, the following rows were inserted.
ACCT_FD_NO
P_TYPE
250398
P
250398
P
260189
P
320107
R
320108
W
There was duplicate of 250398 which i dint enter in the form second time,
All the other P_TYPE was also inserted , but i want only the P_TYPE='P' to be inserted into the database.
I want only those records to be inserted into the form where P_TYPE='P' and duplicate rows must not be entered.
How do i do this??? -
Data not getting inserted in R/3 System from Webdynpro
Hi,
We were trying to insert some data into r/3 z-table using a Custom BAPI using RFC.
But the data is not getting inserted.
Through I commit is being performed explicity.
Please help:
Below is the code :
Controllor code :
public void wdDoInit()
//@@begin wdDoInit()
try{
Z_Bapi_Rfq_Test_Input objStatus = new Z_Bapi_Rfq_Test_Input();
wdContext.nodeZ_bapi_rfq_test().bind(objStatus);
// Create a new element in node Bapi_Transaction_Commit_Input
Bapi_Transaction_Commit_Input inputCommit =
new Bapi_Transaction_Commit_Input();
wdContext.nodeBAPI_TRANSACTION_COMMIT()
.bind(inputCommit);
//Bapi_Transaction_Commit_Input obj;
// wdContext.nodeZ_Bapi_Quo_Salesrep_Status_Input().invalidate();
//wdContext.nodeOutput().invalidate();
//wdContext.nodeRfq_Status().invalidate();
} catch(Exception rfqException){
wdComponentAPI.getMessageManager().reportException("rfqException="+rfqException.getMessage(),true);
//@@end
public void executeBapi( )
//@@begin executeBapi()
try{
Z_Bapi_Rfq_Test_Input obj = wdContext.currentZ_bapi_rfq_testElement().modelObject();
AbstractList objAbBapiPartner = new Bapiparnr.Bapiparnr_List();
Bapiparnr objBapiPartner = new Bapiparnr();
objBapiPartner.setPartn_Numb("0000001046");
objBapiPartner.setPartn_Role("AG");
//obj.addPartner(objBapiPartner);
objAbBapiPartner.add(objBapiPartner);
obj.setPartner(objAbBapiPartner);
Bapisdhd1 objBapisdhd1 = new Bapisdhd1();
objBapisdhd1.setSales_Org("2500");
objBapisdhd1.setDistr_Chan("30");
objBapisdhd1.setDivision("20");
objBapisdhd1.setDoc_Type("ZRFQ");
obj.setHeader(objBapisdhd1);
obj.execute();
// Synchronise the data in the context with the data in the model
wdContext.nodeZ_bapi_rfq_test().invalidate();
wdContext.nodePartner().invalidate();
wdContext.nodeHeader().invalidate();
wdContext.nodeOutput().invalidate();
wdContext.nodeReturn().invalidate();
// Z_Bapi_Quo_Salesrep_Status_Output outPut= obj.getOutput();
// if(outPut!=null){
// List materialList=outPut.getRfq_Status();
// if(materialList!=null){
// wdComponentAPI.getMessageManager().reportSuccess("materialList="+materialList.size());
} catch(Exception rfqException){
wdComponentAPI.getMessageManager().reportException("rfqException="+ rfqException.toString(),true);
//@@end
public void executeBapi_Commit( )
//@@begin executeBapi_Commit()
try {
// Calls remote function module BAPI_Transaction_Commit
wdContext.currentBAPI_TRANSACTION_COMMITElement().modelObject().execute();
wdContext.nodeBAPI_TRANSACTION_COMMIT().invalidate();
wdContext.nodeOutput1().invalidate();
wdContext.nodeReturn().invalidate();
wdContext.nodeReturn1().invalidate();
} catch (WDDynamicRFCExecuteException ce) {
wdComponentAPI.getMessageManager().reportException(ce.getMessage(), false);
//@@end
View Controlloer Code:
public void wdDoInit()
//@@begin wdDoInit()
wdThis.wdGetCControllerController().executeBapi();
wdThis.wdGetCControllerController().executeBapi_Commit();
IWDApplication wedDynApplication=wdComponentAPI.getApplication();
IWDApplicationInfo applicationInfo=wedDynApplication.getApplicationInfo();
Collection collection=applicationInfo.getApplicationProperties();
//@@endHi Gareth,
I was not getting enough time to reply, so replying late.
Actaully the problem was with r/3 BAPI Code itself.
There was condition in the begining of the code to check the data in the workare of R/3, so this condition was failing here.
But when we try to invoke that bapi from r/3 workbench it works fine because the data first comes to R/3 workarea then to R/3 Tables.
But when we insert data from Webdynpro framework , the data directly goes to R/3 Tables rather than the R/3 Workarea. So in Bapi the first condition was failing and no data was getting inserted.
So this was the problem, and we solved it.
Thanks,
Regards,
Aditya metukul -
How to extract data from xml and insert into Oracle table
Hi,
I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
I need to extract the values of these columns and insert into the table
<Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
<Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>Re: Insert from XML to relational table
http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta= -
Hi all,
I have some xml data which i would like to insert into oracle tables.
Where to start up with this?Hi,
Here's another good place to start: [XML DB FAQ|http://forums.oracle.com/forums/thread.jspa?threadID=410714&tstart=0]
You seem to be especially interested in second post in there.
Regards
Peter -
How to read the data from XML file and insert into oracle DB
Hi All,
I have below require ment.
I will receive data in the XML file. then i need to read that data and insert into oracle tables. please let me know how this can be handled.
Many Thanks.Sounds a lot like this question, only with less details.
how to read data from XML variable and insert into table variable
We can only help if you provide us details to help as we cannot see what you are doing and only know what you tell us. Plenty of examples abound on the forums that cover the topics you seek as well. -
Data should get inserted in all tables if i enter the form field only once
Hi, I have a new question again.
There are 5 tables in a database, that is t1, t2, t3, t4 & t5. the first 4 table has one common column, known as lc_no. I have build the form using the form builder. In that form, there is a 1 text field for lc_no. I have not started to code anything as yet in the form because everything with respect to it is working fine and even the data is getting inserted. But the problem is that, when i enter the data in the form, the lc_no gets loaded in only one table. I want the data to get inserted in all the tables. What should i code? How should i start off? I'm very new to this & don't exactly know how do i start with it ?
Thank You. Can you help as i have not yet started to code in this form.
Oracle9i Enterprise Edition Release 9.2.0.1.0.
oracle forms 6i.Let us say table one have lc_no, other columen
Table 2 have LC-no , other columsn
Table 3 have lc-no , other column,
Now in form(which has table1 as base table)
In PRe-Insert write like below
Insert into table2 (lc_no) values (:table1.lc_no) here tabel1 should be block name in form.
Insert into table3 (lc_no) values (:table1.lc_no)
................and so on .. to other table.
So, now when user commits the form, the lc_no will be available in all the other tables.. -
Insert into oracle DB using vb2005
I have a form that has click button1. The problem with this code is after insert command something should be inserted into oracle DB but nothing there(so how to execute insert command and commit it using VB2005), any suggestion should refer to the code.
Imports System
Imports System.Data ' VB.NET
Imports Oracle.DataAccess.Client ' ODP.NET Oracle data provider
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
'System.Data.OracleClient lets you access Oracle databases.
Public con As System.Data.OracleClient.OracleConnection = New System.Data.OracleClient.OracleConnection() 'Oracle.DataAccess.Client.OracleConnection()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim range As Excel.Range
Dim rCnt As Integer
Dim cCnt As Integer
Dim Obj As Object
xlApp = New Excel.ApplicationClass
xlApp.Visible = True
xlWorkBook = xlApp.Workbooks.Open("c:\employee.xls")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
range = xlWorkSheet.UsedRange
For rCnt = 2 To range.Rows.Count
For cCnt = 1 To range.Columns.Count
Obj = CType(range.Cells(rCnt, cCnt), Excel.Range)
'MsgBox(Obj.value)
Next
Next
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)
End Sub
Private Sub releaseObject(ByVal obj As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
obj = Nothing
Catch ex As Exception
obj = Nothing
Finally
GC.Collect()
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim daOracle As New OracleDataAdapter
Dim InsertCommand As New OracleCommand
daOracle.InsertCommand = New OracleCommand
'1.Create connection object to Oracle database
Dim con As OracleConnection = New OracleConnection()
Try
'2.Specify connection string
con.ConnectionString = ("Data Source=mgra;User Id=tmar; Password=grams")
'3. Open the connection through ODP.NET
con.Open()
Catch ex As Exception
'4.display if any error occurs
MsgBox(ex.Message, Microsoft.VisualBasic.MsgBoxStyle.Exclamation, "OraScan")
'3.Create command object to perform a query against the database:
Dim cmdQuery As String = "SELECT * FROM employee"
InsertCommand.CommandText = "insert into meta_objecttypes values(4,'table','table','ERStudio','Demo')"
daOracle.InsertCommand = InsertCommand
' Create the OracleCommand object to work with select
Dim cmd As OracleCommand = New OracleCommand(cmdQuery)
cmd.Connection = con
cmd.CommandType = CommandType.Text
'get the DataReader object from command object
Dim rdr As OracleDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
cmd.ExecuteNonQuery()
'check if it has any row
While rdr.Read()
rdr.Close()
End While
Finally
' Close and Dispose OracleConnection object
con.Close()
con.Dispose()
End Try
End Sub
End ClassFor best results, please repost this to the ODP.NET forum.
-
Error field is not getting populated into corresponding str. in Zrfc
hi,
In case of error in PO creation i am not getting all the data i nto correponding structure..
*data it_head type standard table of bapimepoheader.
DATA ls_head TYPE bapimepoheader.
DATA it_headx TYPE STANDARD TABLE OF bapimepoheaderx.
DATA ls_headx TYPE bapimepoheaderx.
data : it_temp_ekpo type zpo_item_60 occurs 0 with header line.
DATA it_item TYPE STANDARD TABLE OF bapimepoitem.
DATA ls_item TYPE bapimepoitem.
DATA it_itemx TYPE STANDARD TABLE OF bapimepoitemx.
DATA ls_itemx TYPE bapimepoitemx.
DATA it_sch TYPE STANDARD TABLE OF bapimeposchedule .
DATA ls_sch TYPE bapimeposchedule.
DATA it_schx TYPE STANDARD TABLE OF bapimeposchedulx.
DATA ls_schx TYPE bapimeposchedulx.
DATA it_poact TYPE STANDARD TABLE OF bapimepoaccount.
DATA ls_poact TYPE bapimepoaccount.
DATA it_poactx TYPE STANDARD TABLE OF bapimepoaccountx.
DATA ls_poactx TYPE bapimepoaccountx.
DATA it_cond TYPE STANDARD TABLE OF bapimepocond.
DATA ls_cond TYPE bapimepocond.
DATA it_adrc TYPE STANDARD TABLE OF bapimepoaddrdelivery.
DATA st_adrc TYPE bapimepoaddrdelivery.
DATA it_condx TYPE STANDARD TABLE OF bapimepocondx.
DATA ls_condx TYPE bapimepocondx.
DATA it_popart TYPE STANDARD TABLE OF bapiekkop.
DATA ls_popart TYPE bapiekkop.
data : ret2 type bapiret2 occurs 0 with header line.
DATA ls_ekko TYPE zpo_data_60.
DATA st_ekko TYPE zpo_data_60.
DATA ls_ekpo TYPE zpo_item_60.
DATA st_ekpo TYPE zpo_item_60.
DATA: ls_adrc TYPE zpo_adrc_60,
ls_ekkn TYPE zpo_ekkn_60,
ls_eket TYPE zpo_eket_60,
ls_ekbe TYPE zpo_ekbe_60,
w_purchaseorder type BAPIMEPOHEADER-PO_NUMBER.
LOOP AT lt_ekpo INTO st_ekpo.
ls_ekpo = st_ekpo.
AT NEW ebeln.
READ TABLE lt_ekko WITH KEY ebeln = ls_ekpo-ebeln.
IF sy-subrc = 0.
ls_head-comp_code = lt_ekko-bukrs.
ls_head-doc_type = lt_ekko-bsart.
ls_head-vendor = lt_ekko-lifnr.
ls_head-purch_org = lt_ekko-ekorg.
ls_head-pur_group = lt_ekko-ekgrp.
ls_head-pmnttrms = lt_ekko-zterm.
ls_head-exch_rate = lt_ekko-wkurs.
ls_head-incoterms1 = lt_ekko-inco1.
ls_head-incoterms2 = lt_ekko-inco2.
ls_head-currency = lt_ekko-waers.
ls_head-PO_NUMBER = lt_ekko-ebeln.
*append ls_head to it_head.
*Parameter: POHEADERX
ls_headx-comp_code = 'X' .
ls_headx-doc_type = 'X' .
ls_headx-vendor = 'X' .
ls_headx-purch_org = 'X'.
ls_headx-pur_group = 'X' .
ls_headx-pmnttrms = 'X'.
ls_headx-currency = 'X'.
ls_headx-exch_rate = 'X'.
ls_headx-incoterms1 = 'X'.
ls_headx-incoterms2 = 'X'.
ls_headx-currency = 'X'.
ls_headx-PO_NUMBER = 'X'.
*append ls_headx to it_headx.
ENDIF.
ENDAT.
ls_item-po_unit = ls_ekpo-meins.
ls_item-po_item = ls_ekpo-ebelp.
ls_item-material = ls_ekpo-matnr.
ls_item-price_unit = ls_ekpo-peinh.
ls_item-orderpr_un = ls_ekpo-bprme.
ls_item-net_price = ls_ekpo-netpr.
ls_item-matl_group = ls_ekpo-matkl.
ls_item-short_text = ls_ekpo-txz01.
ls_item-plant = ls_ekpo-werks.
ls_item-stge_loc = ls_ekpo-lgort.
ls_item-quantity = ls_ekpo-menge.
ls_item-acctasscat = ls_ekpo-knttp.
ls_item-gr_basediv = ls_ekpo-webre.
ls_item-vend_mat = ls_ekpo-idnlf.
ls_item-no_more_gr = ls_ekpo-elikz.
ls_item-final_inv = ls_ekpo-erekz.
ls_item-gr_ind = ls_ekpo-wepos.
ls_item-gr_non_val = ls_ekpo-weunb.
ls_item-conv_num1 = ls_ekpo-bpumz.
ls_item-conv_den1 = ls_ekpo-bpumn.
ls_item-ir_ind = ls_ekpo-repos.
ls_item-unlimited_dlv = ls_ekpo-uebtk.
ls_item-reminder1 = ls_ekpo-mahn1.
ls_item-reminder2 = ls_ekpo-mahn2.
ls_item-reminder3 = ls_ekpo-mahn3.
ls_item-vend_mat = ls_ekpo-idnlf.
ls_item-no_more_gr = ls_ekpo-elikz.
ls_item-final_inv = ls_ekpo-erekz.
ls_item-gr_ind = ls_ekpo-wepos.
append ls_ekpo to it_temp_ekpo.
*Parameter: POITEMX
ls_itemx-po_unit = 'X'.
ls_itemx-po_item = ls_ekpo-ebelp.
ls_itemx-material = 'X'.
ls_itemx-price_unit = 'X'.
ls_itemx-orderpr_un = 'X'.
ls_itemx-net_price = 'X'.
ls_itemx-matl_group = 'X'.
ls_itemx-short_text = 'X'.
ls_itemx-plant = 'X'.
ls_itemx-stge_loc = 'X'.
ls_itemx-quantity = 'X'.
ls_itemx-acctasscat = 'X'.
ls_itemx-gr_basediv = 'X'.
ls_itemx-vend_mat = 'X'.
ls_itemx-no_more_gr = 'X'.
ls_itemx-final_inv = 'X'.
ls_itemx-gr_ind = 'X'.
ls_itemx-gr_non_val = 'X'.
ls_itemx-conv_num1 = 'X'.
ls_itemx-conv_den1 = 'X'.
ls_itemx-ir_ind = 'X'.
ls_itemx-unlimited_dlv = 'X'.
ls_itemx-reminder1 = 'X'.
ls_itemx-reminder2 = 'X'.
ls_itemx-reminder3 = 'X'.
ls_itemx-vend_mat = 'X'.
ls_itemx-no_more_gr = 'X'.
ls_itemx-final_inv = 'X'.
ls_itemx-gr_ind = 'X'.
APPEND ls_itemx TO it_itemx.
APPEND ls_item TO it_item.
READ TABLE lt_eket INTO ls_eket WITH KEY ebeln = ls_ekpo-ebeln
ebelp = ls_ekpo-ebelp.
IF sy-subrc = 0.
*Parameter: POSCHEDULE
ls_sch-po_item = ls_ekpo-ebelp.
ls_sch-sched_line = LS_EKET-ETENR.
ls_sch-delivery_date = ls_eket-eindt.
ls_sch-quantity = ls_ekpo-menge .
APPEND ls_sch TO it_sch.
ENDIF.
*Parameter: POSCHEDULEX
ls_schx-po_item = ls_ekpo-ebelp.
ls_schx-sched_line = LS_EKET-ETENR.
ls_schx-po_itemx = 'X' .
ls_schx-sched_linex = 'X'.
ls_schx-delivery_date = 'X'.
ls_schx-quantity = 'X' .
APPEND ls_schx TO it_schx.
read table lt_ekkn into ls_ekkn with key ebeln = ls_ekpo-ebeln
ebelp = ls_ekpo-ebelp.
*Parameter: POACCOUNT
IF SY-SUBRC = 0.
ls_poact-po_item = ls_ekpo-ebelp.
ls_poact-serial_no = sy-tabix.
ls_poact-quantity = ls_ekpo-menge.
ls_poact-gl_account = ls_ekkn-sakto.
ls_poact-costcenter = ls_ekkn-KOSTL.
ls_poact-co_area = '1000'.
ls_poact-tax_code = ls_ekkn-mwskz.
APPEND ls_poact TO it_poact.
ENDIF.
*Parameter: POACCOUNTX
ls_poactx-po_item = 'X' .
ls_poactx-serial_no = sy-tabix .
ls_poactx-quantity = 'X' .
ls_poactx-gl_account = 'X' .
ls_poactx-costcenter = 'X' .
ls_poactx-co_area = 'X' .
ls_poactx-tax_code = 'X' .
APPEND ls_poactx TO it_poactx.
*Parameter: POCOND
ls_cond-itm_number = ls_ekpo-ebelp.
ls_cond-cond_st_no = '001' .
ls_cond-cond_type = 'PB00' .
ls_cond-cond_value = '79.900000000' .
ls_cond-currency = ls_ekko-waers.
ls_cond-currency_iso = 'USD'.
ls_cond-cond_unit = 'KG' .
ls_cond-cond_p_unt = '1' .
ls_cond-change_id = 'U' .
APPEND ls_cond TO it_cond.
*Parameter: POCONDX
ls_condx-itm_number = ls_ekpo-ebelp.
ls_condx-cond_st_no = '000' .
ls_condx-itm_numberx = 'X' .
ls_condx-cond_type = 'X' .
ls_condx-cond_value = 'X' .
ls_condx-currency = 'X' .
ls_condx-change_id = 'X' .
APPEND ls_condx TO it_condx.
*Parameter: POPARTNER,
ls_popart-partnerdesc = 'OA' .
ls_popart-langu = 'EN' .
ls_popart-buspartno = '0000001100' .
ls_popart-partnerdesc = 'GS' .
ls_popart-langu = 'EN' .
ls_popart-buspartno = '0000001200' .
ls_popart-partnerdesc = 'IP' .
ls_popart-langu = 'EN' .
ls_popart-buspartno = '0000001000'.
APPEND ls_popart TO it_popart.
Address data
READ TABLE lt_adrc INTO ls_adrc WITH KEY addrnumber = ls_ekko-adrnr.
IF sy-subrc = 0.
st_adrc-addr_no = ls_adrc-addrnumber.
st_adrc-name = ls_adrc-name1.
st_adrc-street = ls_adrc-street.
st_adrc-district = ls_adrc-city2.
st_adrc-postl_cod1 = ls_adrc-post_code1.
st_adrc-city = ls_adrc-city1.
st_adrc-country = ls_adrc-country.
st_adrc-region = ls_adrc-region.
APPEND st_adrc TO it_adrc.
ENDIF.
AT END OF ebeln.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = ls_head
poheaderx = ls_headx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
EXPPURCHASEORDER = w_purchaseorder
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = ret2
poitem = it_item
poitemx = it_itemx
poaddrdelivery = it_adrc
poschedule = it_sch
poschedulex = it_schx
poaccount = it_poact
POACCOUNTPROFITSEGMENT =
poaccountx = it_poactx
POCONDHEADER =
POCONDHEADERX =
pocond = it_cond
pocondx = it_condx
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
popartner = it_popart
POCOMPONENTS =
POCOMPONENTSX =
POSHIPPING =
POSHIPPINGX =
POSHIPPINGEXP =
if w_purchaseorder is not initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
LOOP AT ret2 WHERE type = 'S'.
lt_success_po-ebeln = ret2-message_v2.
lt_success_po-type = ret2-type.
lt_success_po-message = ret2-message.
append lt_success_po.
clear : lt_success_po.
ENDLOOP.
else.
append lt_ekko to lt_ekko_error.
append it_temp_ekpo to lt_ekpo_error.
append ls_eket to lt_eket_error.
append ls_adrc to lt_adrc_error.
append ls_ekkn to lt_ekkn_error.
*loop at ret2 where type = 'E'.
**move-corresponding lt_ekko to lt_error_po.
**move-corresponding ls_ekpo to lt_error_po.
**move ret2-type to lt_error_po-type.
**move ret2-message to lt_error_po-message.
*append
**lt_error_po.
**clear :
**lt_error_po.
endloop.
endif.
CLEAR : ls_ekko,
st_ekko,
ls_ekpo,
st_ekpo,
ls_ekkn,
ls_ekbe,
ls_eket.
ENDAT.
ENDLOOP.
ENDFUNCTION.
Message was edited by:
ruban RYou must get all the messages into
RET2
table.
You need to fill your ZRFC's RETURN table with the data from RET2 after the FM 'BAPI_PO_CREATE1' call. Because your BAPI is calling mulitple times and henceforth your RET2 is being refreshed and contains the last executed BAPI's return message.
So,
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
EXCEPITON
LOOP AT RET2.
MOVE-CORRESPONDING RET2 TO IT_RETRUN. " << This is the table which you need to pass back to ZRFC
APPEND IT_RETURN.
ENDLOOP.
Regards,
Naimesh Patel
Maybe you are looking for
-
Will Quadro 1000N card work with Mercury Playback Engine?
The NVIDIA Quadro 1000M graphics card isn't listed as a recommended graphics card for running Premiere Pro CC 2014. Does anyone know if it will work with MPE?
-
Hi, I have ichat and my girl friend has aol. We were video chating and everything was going great, but there was a problem. She can hear me but I can't hear her threw my speakers. Her Logitech has a mic built in but nothing. The mic icon on ichat is
-
Guys, How do you publish report views on the web after creating BEX reports? Thanks, RG
-
Hi , I made a subtitle in a timeline( in persian) and I want to use the same in another project. I exported the sub. and imported in new project but there are differences between the characters. how can I correct it?? thank you so much.
-
Verizon's third party application service provider for internationale texts
Hi, I read here that Verizon uses a third party service provider to route international text messages. On that link they say it's a company called Inphomatch, but I found out that Inphomatch merged to another company called Sybase, and on Sybase's we