Possible to update and insert in a table at a same time
Hi friends,
I have a table with six columns in it.
Initially that table will have seven rows with six columns, but all the columns wont have a content in it. But only one column will have the content of seven rows. so that's why initially it will have seven rows.
Assume that first column consist of the following seven content each in a row(so seven row)
*)A
*)B
*)C
*)D
*)E
*)F
*)G
So what i need to do is set DML operation such that for the existing seven rows which is in the table i need to update the value of the remaining six column and at the same time i need to insert all the seven rows of only the first column in the next seven rows.
Whether it is possible to do it.
How to achieve it friends,
Thanks
Regards,
Mini
Hi,
It should be like
Initially my table would be like the below
*questions StronglyAgree DA AG suggestions*
what is ur name?
what is ur age?
which is ur pet? My DML operation should be like it should update and insert
Update in the sense, it should be like
*questions StronglyAgree DA AG suggestions*
what is ur name? y my name
what is ur age? y my age
which is ur pet? y my petSoon after that insert should be like
*questions StronglyAgree Disagree Agree suggestions*
what is ur name? y my name
what is ur age? y my age
which is ur pet? y my pet
what is ur name?
what is ur age?
which is ur pet?It should be like the above..
All izz well
GTA
Edited by: GTA on Jun 13, 2011 6:43 AM
Edited by: GTA on Jun 13, 2011 6:43 AM
Similar Messages
-
Hi All,
I am uploading data from a txt file into itab_infile and wants to update the table Zppprice based on itab_infile. It the record is existing it has to update and when it is a new record it has to insert the record. And I need to capture how many records havebeen updated and inserted.
Please help me.
Thanks,
Veni.
REPORT ZSD_PRICEPROTEC NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 60.
TABLES: KNA1,ZPPPRICE.
TYPES: BEGIN OF type_infile,
KUNNR(10) TYPE c, "Customer Number
MATNR(18) TYPE c, "Material Number
CRDATE(10) TYPE c, "Creation Date
EFDATE(10) TYPE c, "Effective date
SPRICE(15) TYPE c, "Old Price
EPRICE(15) TYPE c, "New Price
EOHQTY(09) TYPE c, "Estimated Quantity
AOHQTY(09) TYPE c. "Actual Quantity
TYPES: END OF type_infile.
* Internal tables
DATA: itab_infile TYPE STANDARD TABLE OF type_infile with header line.
* Work areas
DATA: wa_infile TYPE type_infile.
* Global variables.
DATA: gc_tcode LIKE sy-tcode VALUE 'VA01'. "Transaction code
SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE text-001.
PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK one.
START-OF-SELECTION.
PERFORM upload_text_file.
*& Form UPLOAD_TEXT_FILE
FORM upload_text_file.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab_infile
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE e208(00) WITH 'Error in loading text file'.
ENDIF.
ENDFORM. " UPLOAD_TEXT_FILEHi Veni,
Simple thing ,you can use MODIFY Command,it works both insert as well update.
check the documentation.
see the below program and i am getting data from XLS file and i am updating to Ztable( same as ur case ).
Program : ZLWMI151_UPLOAD(Data load to ZBATCH_CROSS_REF Table)
Type : Upload program
Author : Seshu Maramreddy
Date : 05/16/2005
Transport : DV3K919574
Transaction: None
Description: This program will get the data from XLS File
and it upload to ZBATCH_CROSS_REF Table
REPORT ZLWMI151_UPLOAD no standard page heading
line-size 100 line-count 60.
*tables : zbatch_cross_ref.
data : begin of t_text occurs 0,
werks(4) type c,
cmatnr(15) type c,
srlno(12) type n,
matnr(7) type n,
charg(10) type n,
end of t_text.
data: begin of t_zbatch occurs 0,
werks like zbatch_cross_ref-werks,
cmatnr like zbatch_cross_ref-cmatnr,
srlno like zbatch_cross_ref-srlno,
matnr like zbatch_cross_ref-matnr,
charg like zbatch_cross_ref-charg,
end of t_zbatch.
data : g_repid like sy-repid,
g_line like sy-index,
g_line1 like sy-index,
$v_start_col type i value '1',
$v_start_row type i value '2',
$v_end_col type i value '256',
$v_end_row type i value '65536',
gd_currentrow type i.
data: itab like alsmex_tabline occurs 0 with header line.
data : t_final like zbatch_cross_ref occurs 0 with header line.
selection-screen : begin of block blk with frame title text.
parameters : p_file like rlgrap-filename obligatory.
selection-screen : end of block blk.
initialization.
g_repid = sy-repid.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = g_repid
IMPORTING
FILE_NAME = p_file.
start-of-selection.
Uploading the data into Internal Table
perform upload_data.
perform modify_table.
top-of-page.
CALL FUNCTION 'Z_HEADER'
EXPORTING
FLEX_TEXT1 =
FLEX_TEXT2 =
FLEX_TEXT3 =
*& Form upload_data
text
FORM upload_data.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_file
I_BEGIN_COL = $v_start_col
I_BEGIN_ROW = $v_start_row
I_END_COL = $v_end_col
I_END_ROW = $v_end_row
TABLES
INTERN = itab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
write:/10 'File '.
ENDIF.
if sy-subrc eq 0.
read table itab index 1.
gd_currentrow = itab-row.
loop at itab.
if itab-row ne gd_currentrow.
append t_text.
clear t_text.
gd_currentrow = itab-row.
endif.
case itab-col.
when '0001'.
t_text-werks = itab-value.
when '0002'.
t_text-cmatnr = itab-value.
when '0003'.
t_text-srlno = itab-value.
when '0004'.
t_text-matnr = itab-value.
when '0005'.
t_text-charg = itab-value.
endcase.
endloop.
endif.
append t_text.
ENDFORM. " upload_data
*& Form modify_table
Modify the table ZBATCH_CROSS_REF
FORM modify_table.
loop at t_text.
t_final-werks = t_text-werks.
t_final-cmatnr = t_text-cmatnr.
t_final-srlno = t_text-srlno.
t_final-matnr = t_text-matnr.
t_final-charg = t_text-charg.
t_final-erdat = sy-datum.
t_final-erzet = sy-uzeit.
t_final-ernam = sy-uname.
t_final-rstat = 'U'.
append t_final.
clear t_final.
endloop.
delete t_final where werks = ''.
describe table t_final lines g_line.
sort t_final by werks cmatnr srlno.
Deleting the Duplicate Records
perform select_data.
describe table t_final lines g_line1.
modify zbatch_cross_ref from table t_final.
if sy-subrc ne 0.
write:/ 'Updation failed'.
else.
Skip 1.
Write:/12 'Updation has been Completed Sucessfully'.
skip 1.
Write:/12 'Records in file ',42 g_line .
write:/12 'Updated records in Table',42 g_line1.
endif.
delete from zbatch_cross_ref where werks = ''.
ENDFORM. " modify_table
*& Form select_data
Deleting the duplicate records
FORM select_data.
select werks
cmatnr
srlno from zbatch_cross_ref
into table t_zbatch for all entries in t_final
where werks = t_final-werks
and cmatnr = t_final-cmatnr
and srlno = t_final-srlno.
sort t_zbatch by werks cmatnr srlno.
loop at t_zbatch.
read table t_final with key werks = t_zbatch-werks
cmatnr = t_zbatch-cmatnr
srlno = t_zbatch-srlno.
if sy-subrc eq 0.
delete table t_final .
endif.
clear: t_zbatch,
t_final.
endloop.
ENDFORM. " select_data
Thanks
Seshu -
Updating a field in multiple tables at the same time
Hi All,
I have a table with right and wrong values of a field 'id'. I want to replace the wrong values in all the tables at all_tab_columns with the right values. I did the following and it did not work. Please help.
CREATE OR REPLACE PROCEDURE Clean_ID_Proc(v_id number) IS
right_id number;
v_table_name varchar2(100);
BEGIN
Select correct_id into right_id from tb_id
where wrong_id = v_id;
FOR table_cur IN (select * from all_tab_columns
where column_name = 'ID')
LOOP
EXECUTE IMMEDIATE 'update '||table_cur.table_name||' set id = '||right_id||' where id ='|| v_id;
END LOOP;
END;The error I have been getting is :
[1]: ORA-00942: table or view does not exist
[1]: ORA-06512: at "schema.CLEAN_ID_PROC", line 12
[1]: ORA-06512: at line 1
Thanks in advanceuser7415666 wrote:
Hi All,
I have a table with right and wrong values of a field 'id'. I want to replace the wrong values in all the tables at all_tab_columns with the right values. I did the following and it did not work. Please help.
CREATE OR REPLACE PROCEDURE Clean_ID_Proc(v_id number) IS
right_id number;
v_table_name varchar2(100);
BEGIN
Select correct_id into right_id from tb_id
where wrong_id = v_id;
FOR table_cur IN (select * from all_tab_columns
where column_name = 'ID')
LOOP
EXECUTE IMMEDIATE 'update '||table_cur.table_name||' set id = '||right_id||' where id ='|| v_id;
END LOOP;
END;The error I have been getting is :
[1]: ORA-00942: table or view does not exist
[1]: ORA-06512: at "schema.CLEAN_ID_PROC", line 12
[1]: ORA-06512: at line 1
Thanks in advancewhat is the actual table_name of the table being updated?
who owns this table?
which USER owns & runs posted code?
why did you bother populating TB_ID table instead of doing the UPDATE at that time? -
Problem while update and insert data in table
Hi All,
I have problem while save line data....
I have an advance table.I take remove and duplicate line in message choice of advance table action layout.
Also there is one temp table to save Po number data which is populated in advance table according to PO Number search.And In Temp table record number is column which use
to insert and update data in temp table which mention in procedure
Problem is that : When i Searched PO Number and duplicate line and save that record it insert a new line always and it insert record according to duplicate line no .It not update previous line,insert new line always according to duplicate line no.
Please tell me what is solution?
Thanks,
NeilHi,
I am not cleared with your requirement.
If possible send me the screenshots for the same.
--Sushant
[email protected] -
Hi All,
I have a purpose in winforms to have a "notepad like" editor that saves what ever i type to a file on the hard drive and reads from based.
So what i have is a tab with a richtextbox docked to fill. I would like to have that richtextbox read from a file on the hard drive, then save the changes i type when i either click off the tab or live if possible.
I wills state that i am fairly new to the c# game and if this is possible and someone could post an example that would be awesome and totally appreciated.
Thanks,
jACFor those that are looking for the solution I went with here are the details
Reading the file:
// Wish List Section
wishListRichTextBox.ResetText();
string wlFolder = Application.StartupPath + "\\wishLists\\";
string wlPath = wlFolder + selectedProduct + ".rtf";
// Read from the text file and out put the results
try
{ // create directory if it does not exist
if (!Directory.Exists(wlFolder))
Directory.CreateDirectory(wlFolder);
} // create file if it does not exist
if (!File.Exists(wlPath))
File.Create(wlPath).Dispose();
var iStream = new FileStream(wlPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var sr = new System.IO.StreamReader(iStream);
var readData = sr.ReadToEnd();
wishListRichTextBox.Text = readData;
sr.Close();
// If the read fails then output the error message in the same section
catch (Exception ex)
wishListRichTextBox.Text = "Error: " + ex.Message;
Writing the file:
private void wishlistTabChanged(object sender, EventArgs e)
if(menuTabControl.SelectedTab != wishListTab){
if (productComboBox.SelectedIndex >= 0)
try
string wlFolder = Application.StartupPath + "\\wishLists\\";
string wlPath = wlFolder + productComboBox.SelectedItem + ".rtf";
var oStream = new FileStream(wlPath, FileMode.Open, FileAccess.Write, FileShare.Read);
oStream.SetLength(0);
var sw = new System.IO.StreamWriter(oStream);
sw.WriteLine(wishListRichTextBox.Text);
sw.Close();
catch (Exception ex)
MessageBox.Show("Wish list for " + productComboBox.Text + " save failed. \n\nError: " +
ex, "Wish List Save Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
I mainly used Ammar.Zaied thought
process on this. Thanks to everyone though, as you all pointed me in the right direction -
I have recently changed from Excel to numbers and i can't work out how to change cells. I have a sheet for each month, on that sheet i have all my outgoings on a daily basis. Those cells are the same in every table. In Excel i could hold shift and click the tab for each month and then change the information in all those cells. Can i do this in Numbers, if so how?
This is not a feature of Numbers.
-
Is it possible to load and send variables to php at the same time?
Hello, with this line:
request.method = URLRequestMethod.GET; you can receive
variables from php.
and with request.method = URLRequestMethod.POST you can send
variables.
But is it possible to do this simultaniously ?they both send and receive data sequentially. ie, data is
sent (if there is any) and then data is received (if there is
any). -
Use of the "updlock" hint with update and insert statements
I have inherited some stored procedures and am trying to figure out why the developers decided to use the "updlock" hint on many of the update and insert statements. I have looked around everywhere and have found only one explanation of why "update...with
(updlock)" can be useful, namely when a table has no clustered index:
http://www.sqlnotes.info/2012/10/10/update-with-updlock/ I have found nothing yet that mentions why "insert into...with (updlock)" might be used. I understand why the hint
might be useful on select statements in some cases, but if all of the tables have clustered indexes, is there any good reason to use it on update and insert statements?
Thanks,
Ron
Ron RiceThis form of deadlock error can occur on a table which has a clustered index.
If you are doing updates on a table which has a clustered index and that table also has a nonclustered index and the nonclustered index is used to find the row to update you can see this type of deadlock. For example create a table with a clustered
primary key index and a nonclustered index by running
Create Table Foo(PK int primary key identity, OtherKey varchar(10), OtherData int);
go
Insert Foo Default Values;
go 10000
Update Foo Set OtherKey = 'C' + Cast(PK As varchar(10))
Create Unique Index FooIdx On Foo(OtherKey);
That creates a table with 10000 rows, a clustered index and a nonclustered index. Then run
Begin Transaction
Update Foo Set OtherData = 1 Where OtherKey = 'C5'
That will use the FooIdx index to find the row that needs to be updated. It will get a U lock on the index row in the FooIdx index, then an X lock on the row in the clustered index, update that row, then free the U lock on FooIdx, but keep the X lock
on the row in the clustered index. (There is other locking going on, but to simplify things, I'm only showing the locks that lead to the deadlock).
Then in another window, run
Begin Transaction
Update Foo Set OtherData = 2 Where OtherKey = 'C5'
This will get a U lock on the index row in the FooIdx index, then try to get an X lock on the row in the clustered index. But that row is already exclusively locked, so this second window will wait holding a U lock on FooIdx row and is waiting for
an X lock on the clustered index row.
Now go back to the first window and run
Update Foo Set OtherData = 3 Where OtherKey = 'C5'
This will once again try to get the U lock on the FooIdx row, but it is blocked by the U lock the second window holds. Of course the second window is blocked by the X lock on the clustered index row and you have a deadlock.
All that said, I certainly do not routinely code my updates with UPDLOCK. I try to design databases and write code so that deadlocks will be rare without holding excessive locks. The more locks you hold and the longer you hold them, the more
blocking you will get and the slower your system will run. So I write code that if a deadlock exception occurs, it is properly handled. Then if too many deadlocks occur, that is the time to go back to the code to see what changes are needed to
decrease the number of deadlocks (one way to do that may be to get locks earlier and/or hold them longer.
But I wouldn't worry much about this form of deadlock. It is, in my experience, vary rare. I don't recall ever seeing it in a production environment.
Tom -
Mutilple updations and insertions by BAPI_SALESORDER_CHANGE at one time
Hi ,
I just want to know whether it is possible to insert and update multiple line items in a sales order through the BAPI BAPI_SALESORDER_CHANGE .
we tried doin it for single record ( update and insert ) , it is working fine . but when we try for mutiple items , it gives a system dump.
could you plz help out , how to pass the parameters for mutiple updation and insertions at a time?HI ALL,
I THINK IF WE MAKE THE SCHEDULE LINE ITEM NO. TO BE UNIQUE FOR EACH LINE ITEM IT GETS UPLOADED PROPERLY. THE VBEP-ETENR IS 001 ONLY. PEOPLE WITH ALTERNAT ANSWERS PLZ. CORRECT.
SEE CODES BELOW.
**This creates additional line no. in the sales order.
**Material no is hard coded, you need to change the materisl no in
**available in ur system.
T_ITEM-itm_number = ''.
T_ITEM-material = 'AGA350'.
T_ITEM-target_qty = '2'.
APPEND T_ITEM.
T_ITEMx-itm_number = ''.
T_ITEMX-UPDATEFLAG = 'I'.
T_ITEMX-target_qty = 'X'.
T_ITEMX-material = 'X'.
APPEND T_ITEMX.
T_SCHE-SCHED_LINE = '1'.
T_SCHE-REQ_QTY = 2.
t_sche-req_date = '20080204'.
APPEND T_SCHE.
T_SCHEX-updateflag = c_insertflag.
t_schex-req_date = 'X'.
T_SCHEX-SCHED_LINE = '1'.
t_schex-req_qty = 'X'.
APPEND T_SCHEX.
**This also creates additional line no. in the sales order.
**Material no is hard coded, you need to change the materisl no in
**available in ur system.
*T_ITEM-itm_number = ''.
T_ITEM-material = 'AGA350'.
T_ITEM-target_qty = '1'.
APPEND T_ITEM.
*T_ITEMx-itm_number = ''.
T_ITEMX-UPDATEFLAG = 'I'.
T_ITEMX-target_qty = 'X'.
T_ITEMX-material = 'X'.
APPEND T_ITEMX.
T_SCHE-SCHED_LINE = '4'.
t_sche-req_date = '20080202'.
T_SCHE-REQ_QTY = 1.
APPEND T_SCHE.
T_SCHEX-updateflag = c_insertflag.
t_schex-req_date = 'X'.
T_SCHEX-ITM_NUMBER = 'X'.
T_SCHEX-SCHED_LINE = '4'.
T_SCHEX-REQ_QTY = 'X'.
APPEND T_SCHEX.
**This also creates additional line no. in the sales order.
**Material no is hard coded, you need to change the materisl no in
**available in ur system.
*T_ITEM-itm_number = ''.
T_ITEM-material = 'AGA350'.
T_ITEM-target_qty = '1'.
APPEND T_ITEM.
*T_ITEMx-itm_number = ''.
T_ITEMX-UPDATEFLAG = 'I'.
T_ITEMX-target_qty = 'X'.
T_ITEMX-material = 'X'.
APPEND T_ITEMX.
T_SCHE-SCHED_LINE = '5'.
t_sche-req_date = '20080202'.
T_SCHE-REQ_QTY = 1.
APPEND T_SCHE.
T_SCHEX-updateflag = c_insertflag.
t_schex-req_date = 'X'.
T_SCHEX-ITM_NUMBER = 'X'.
T_SCHEX-SCHED_LINE = '5'.
T_SCHEX-REQ_QTY = 'X'.
APPEND T_SCHEX.
**This also creates additional line no. in the sales order.
**Material no is hard coded, you need to change the materisl no in
**available in ur system.
*T_ITEM-itm_number = ''.
T_ITEM-material = 'AGA350'.
T_ITEM-target_qty = '1'.
APPEND T_ITEM.
*T_ITEMx-itm_number = ''.
T_ITEMX-UPDATEFLAG = 'I'.
T_ITEMX-target_qty = 'X'.
T_ITEMX-material = 'X'.
APPEND T_ITEMX.
T_SCHE-SCHED_LINE = '6'.
t_sche-req_date = '20080202'.
T_SCHE-REQ_QTY = 1.
APPEND T_SCHE.
T_SCHEX-updateflag = c_insertflag.
t_schex-req_date = 'X'.
T_SCHEX-ITM_NUMBER = 'X'.
T_SCHEX-SCHED_LINE = '6'.
T_SCHEX-REQ_QTY = 'X'.
APPEND T_SCHEX.
*i_order_header_in-sd_doc_cat -
How can we do policy updations and insertion using procedures in insurence?
how can we do policy updations and insertion using procedures in insurence?
please answer for this post i need faced in interview.how can we write the code for that procedure in policy details using procedures in plsql.997995 wrote:
how can we do policy updations and insertion using procedures in insurence?
please answer for this post i need faced in interview.how can we write the code for that procedure in policy details using procedures in plsql.You are asking about a specific business area (Insurance) and the nuances of that business (Insurance Policies) and providing no technical details about what is required, on a technical forum. There are many varied businesses in the world and not everyone here is going to be familiar with the area of business you are referring to.
As a technical forum, people are here to assist with technical issues, not to try and help you answer questions in an interview for something you clearly know nothing about, so that you can get a job that you won't know how to do.
If you have a specific technical issue, post appropriate details, including database version, table structures and indexes, example data and expected output etc. as detailed in the FAQ: {message:id=9360002} -
what is the difference between update and insert in the case of database tables? what does update do and what does insert do?
Hi,
Insert Functionality,
Inserts new lines in a database table.By default, data is only inserted in the current client. Data can only be inserted using a view if the view refers to a single table and was defined in the ABAP Dictionary with the maintenance status "No restriction".
Update Functionality,
Updates values in a database table. Normally, lines are updated only in the current client.
INSERT & UPDATE belongs to the Open SQL command set.
Thanks
Nimesh S. Patel -
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= -
Please recommend if we have options to read xml file and insert data into table without a temporary table.
DECLARE @data XML;
SET @data =N'<Root>
<List RecordID="946236" />
<List RecordID="946237" />
<List RecordID="946238" />
<List RecordID="946239" />
<List RecordID="946240" />
</Root>'
INSERT INTO t (id) SELECT T.customer.value('@RecordID', 'INT') AS id
FROM @data.nodes('Root/List')
AS T(customer);
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Dequeue XML from Oracle AQ and insert data into table
Using PL/SQL in a stored procedure, I need to dequeue a message from an Oracle AQ queue, parse the XML content and insert the data in an Oracle table. This is being done in Oracle 9.2.x.
The payload for the message consists of 2 attributes, APPLICATION_DATA (VARCHAR2(32) and MESSAGE_BODY (CLOB). The MESSAGE_BODY is an XML document. A sample of the message is shown below:
(M_NAME=MSG_LAW_WR_CRE_UPD, <?xml version = "1.0"?>
<MSG_LAW_WR_CRE_UPD ID = "WMIS-4744" SRC_SYSTEM_CODE = "WMIS" SRC_SYSTEM_INSTANCE = "WMIS">
<WR:CMP_LAW_WR_CRE_UPD xmlns:WR = "WR" >
<WR:DATETIME>12/19/2005</WR:DATETIME>
<WR:RUSCODE>100</WR:RUSCODE>
<WR:WRNO>38213</WR:WRNO>
</WR:CMP_LAW_WR_CRE_UPD>
</MSG_LAW_WR_CRE_UPD>)
This message needs to be dequeued from a queue named INBOUND, parsed and inserted into a table named INFO_TO_ACCT (CREATEDATE date, RUSCODE varchar2(10), WRNO number).
Any help would be appreciated.SELECT EXTRACTVALUE(xmltype('<?xml version = "1.0"?>
<MSG_LAW_WR_CRE_UPD ID = "WMIS-4744" SRC_SYSTEM_CODE = "WMIS" SRC_SYSTEM_INSTANCE = "WMIS">
<CMP_LAW_WR_CRE_UPD>
<DATETIME>12/19/2005</DATETIME>
<RUSCODE>100</RUSCODE>
<WRNO>38213</WRNO>
</CMP_LAW_WR_CRE_UPD>
</MSG_LAW_WR_CRE_UPD>'),'//DATETIME/text()') FROM DUAL;
hope this helps. -
How to update and insert the records without using Table_comparison and Map_operation?
Use either join or MERGE see this Inserting, Updating, and Deleting Data by Using MERGE
Maybe you are looking for
-
Transfer credit from one account to another
My wife and I each have iTune accounts. Her account has credit on it. Is there a way for her to transfer that credit to my account?
-
In the Pages Program template on the 4 column page a text is wrapped around a violinist. How do I have to prepare the photo to have a similar result. Thanks
-
Help setting node height in a JTree
I have a JTree in which i would like to make the font of the nodes somewhat large (size 16). However, by setting the node's font to this size, i notice that the top and bottom of the node values are truncated. I was wondering how i could increase eac
-
i just downloaded a rental movie, but started the video about half way through the download. Everything was fine until the movie locked up (froze) and became unresponsive. Even iTunes became unresponsive. i had to force quit to even use my Mac. no
-
I Am getting e.mails on my ipad to my gmail but they are not coming to my iPhone 4s