How to update column values in a table where that column is referring to different tables
i have a table Order it has columns
OrderID, Name, Total
1 trade value populated from i.e. tradeorder table
2 fixed value is populated from fixedorder table
3 annual value populated from another table
I m thinking of creating function for every order id to call those tables..
and there are many insertions taking place in order table ,,at the moment its 20 rows ..
kindly provide your suggestions
You can group rows in order table and update the set of row from the specific table. For instance
UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [TRADEORDER] B ON A.ORDERID=B.ORDERID WHERE A.NAME='TRADE'
UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [FIXEDORDER] B ON A.ORDERID=B.ORDERID WHERE A.NAME='FIXED'
UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [ANOTHERTABLE] B ON A.ORDERID=B.ORDERID WHERE A.NAME='ANNUAL'
Regards, RSingh
Similar Messages
-
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya -
SOP: How to update ratio values
Hi everyone,
I have defined an Information Structure with some characteristics and ratios, all of them associated to some ZTable fields.
Well, I would be very grateful whether someone could tell how to update ratio values in my Information Structure. I mean I would like to know which are the steps I have to follow in order to update tha value of my ratios everytime its associated ZField changes its value.
I have the idea of using this Information Structure in a "Level-by-Level" planning type using Product Groups.
Thanks in advance and best regards.
Ben.Hi again,
Actually I have already created my planning type with some macro instructions and I have checked that they work properly in MC94. I have also created a planning hierarchy as you requested.
But my problem doesn't deal with this. The key figures that I have included in my structure represent values in SAP (i.e. Sold units, Security stocks...).
What I need to do is update the value of that key figures in my structure for all the combinations of my characteristics.
I hope my explanation is quite better this time.
Thanks. -
Return the rows of the table where a column contains a specific value first
I want my query to return the rows of the table where a column contains a specific values first in a certain order, and then return the rest of the rows alphabetized.
For Example:
Country
ALBANIA
ARGENTINA
AUSTRALIA
CANADA
USA
Now i want USA and CANADA on top in that order and then other in alphabetized order.
Edited by: 986155 on Feb 4, 2013 11:12 PM986155 wrote:
If it is 2 then i can write a case... i want generalised one where may be around 5 or 6 mentioned should be in descending order at the top and remaining in ascending order there after.Computers tend not to work in 'generalized' ways... they require specifics.
If you store your "top" countries in a table you can then simply do something like...
SQL> ed
Wrote file afiedt.buf
1 with c as (select 'USA' country from dual union
2 select 'Germany' from dual union
3 select 'India' from dual union
4 select 'Australia' from dual union
5 select 'Japan' from dual union
6 select 'Canada' from dual union
7 select 'United Kingdom' from dual union
8 select 'France' from dual union
9 select 'Spain' from dual union
10 select 'Italy' from dual
11 )
12 ,t as (-- top countries
13 select 'USA' country from dual union
14 select 'United Kingdom' from dual union
15 select 'Canada' from dual
16 )
17 select c.country
18 from c left outer join t on (t.country = c.country)
19* ORDER BY t.country, c.country
SQL> /
COUNTRY
Canada
USA
United Kingdom
Australia
France
Germany
India
Italy
Japan
Spain
10 rows selected. -
Listing tables where particular column exists
I want to list the tables where particular column is refered how do i do this thru sql plus?
Thanks in advance
SudhaDo you mean this?
select table_name from user_tab_columns where column_name like 'N%ID';Lennert -
How to update the value of a column when a row is deleted
Hi,
My requirement is basically i have a table .Below is a sample data along with sample data
Column A Column B ColumnC
1 SAM 0
2 RAM 0
Now if i run a delete statement saying
delete from Table where ColumnA =1 then i want to see the value of ColumnC to be updated as 1.The row shouldnt be deleted however the value of ColumnC should be changed to 1.
Can someone please help me with any suggestions? I can create a trigger but i havent worked with triggers so not sure on how to use it.
Please let me know if i am unclear or if you need any details.
ThanksAs I understand what you need is an INSTEAD OF DELETE trigger like below
CREATE TRIGGER Trg_TableName
ON TableName
INSTEAD OF DELETE
AS
BEGIN
UPDATE t
SET ColumnC = 1
FROM TableName t
WHERE EXISTS (SELECT 1
FROM DELETED
WHERE ColumnA = t.ColumnA
END
this will set ColumnC to 1 and will not do an actual delete of the row.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How to update precision value in number datatype
hello all
i hava a database containing data in that there is a table which contan a number datatype
that is number(10)
the table contain large amount of data
now i need the precision value 2
that is number(10,2)
how i can update is
i try alter command the do this bu the error is there the table contain data
so please suggest the solution
thanks in advanceThe number of columsn has nothing to do with it. The number of rows has nothing to do with it.
Here is a step-by-step example to address your problem. I will change DATA_OBJECT_ID from NUMBER to NUMBER(10,2) even though there are thousands of rows in the table, the column is "in the middle " of the table, and there are many rows with non-null values in that column.
07:02:43 > create table t3 as select * from all_objects;
Table created.
Elapsed: 00:00:06.22
07:04:08 > desc t3
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
OBJECT_NAME NOT NULL VARCHAR2(30)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED NOT NULL DATE
LAST_DDL_TIME NOT NULL DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
NAMESPACE NOT NULL NUMBER
EDITION_NAME VARCHAR2(30)
07:04:12 > alter table t3 modify (data_object_id number(10));
alter table t3 modify (data_object_id number(10))
ERROR at line 1:
ORA-01440: column to be modified must be empty to decrease precision or scale
Elapsed: 00:00:00.98
07:08:05 > select count(*), min(data_object_id), max(data_object_id), count(distinct data_object_id), count(data_object_id)
07:09:06 2 from t3;
COUNT(*) MIN(DATA_OBJECT_ID) MAX(DATA_OBJECT_ID) COUNT(DISTINCTDATA_OBJECT_ID) COUNT(DATA_OBJECT_ID)
184456 0 1526320 12225 70092
1 row selected.
Elapsed: 00:00:00.11
07:09:41 > alter table t3 add (temp_data_object_id number(10,2));
Table altered.
Elapsed: 00:00:00.07
07:10:27 > update t3 set temp_data_object_id = data_object_id, data_object_id = null;
184456 rows updated.
Elapsed: 00:00:04.49Notice that our column of interest is now entirely null, so the restriction against reducing its scale or precision will not longer impact us.
07:11:00 >
07:11:17 > select count(*), min(data_object_id), max(data_object_id), count(distinct data_object_id), count(data_object_id) from t3;
COUNT(*) MIN(DATA_OBJECT_ID) MAX(DATA_OBJECT_ID) COUNT(DISTINCTDATA_OBJECT_ID) COUNT(DATA_OBJECT_ID)
184456 0 0
1 row selected.
Elapsed: 00:00:00.04
07:11:51 > alter table t3 modify (data_object_id number(10,2))
07:12:33 > /
Table altered.
Elapsed: 00:00:00.07
07:12:35 > update t3 set data_object_id=temp_data_object_id;
184456 rows updated.
Elapsed: 00:00:04.01
07:14:40 > select count(*), min(data_object_id), max(data_object_id), count(distinct data_object_id), count(data_object_id) from t3;
COUNT(*) MIN(DATA_OBJECT_ID) MAX(DATA_OBJECT_ID) COUNT(DISTINCTDATA_OBJECT_ID) COUNT(DATA_OBJECT_ID)
184456 0 1526320 12225 70092
1 row selected.
Elapsed: 00:00:00.09
07:14:49 > alter table t3 drop column temp_data_object_id;
Table altered.
Elapsed: 00:00:02.40
07:15:11 > desc t3
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
OBJECT_NAME NOT NULL VARCHAR2(30)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
DATA_OBJECT_ID NUMBER(10,2)
OBJECT_TYPE VARCHAR2(19)
CREATED NOT NULL DATE
LAST_DDL_TIME NOT NULL DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
NAMESPACE NOT NULL NUMBER
EDITION_NAME VARCHAR2(30)
07:15:15 > -
Reg:How to update VC values using BAPI_SALESORDER_CREATEFROMDAT2
Hi,
We are creating sales order using the BAPI_SALESORDER_CREATEFROMDAT2 FM but we also want to update variant configuration values in those sales orders. I'm passing these tables (ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_VALUE) to the FM.'
The sales order is been created but the VC characteristics are not getting updated.
After the FM I am calling the commit also..
Am I missing anything..Please guide me how to update the VC values..hi,
use swo1 for uploading BAPIs
regards,
uttam. -
User_sdo_geom_metadata - how to update tolerance value
Hello,
I need to update my tolerance values within the DIMINFO field of the user_sdo_geom_metadata table. I'm new to updating "objects" via sql.
Could someone provide an SQL example of how to update the tolerance value(s).
Thanks very much,
David HagemannI need to query points at a certain distance from the interstate.
This is my query
=======================
select objectid
from Table_points , interstates
where highway = 'I 95'
and mdsys.sdo_within_distance (
Table_points.shape, interstates.geom,
'distance=2.5 layer_gtype=POINT') = 'TRUE';
=======================
This is the error I got
ERROR at line 1:
ORA-13285: Geometry coordinate transformation error
ORA-29400: data cartridge error
ORA-22060: argument [2] is an invalid or uninitialized number
ORA-06512: at "MDSYS.SDO_3GL", line 160
ORA-06512: at "MDSYS.SDO_3GL", line 266
ORA-06512: at line 1
=========================
Anyone has an idea where I am wrong
Thanks
Tan -
How to update the value of setter and getter..!!
Hii all i am developing an portal application in which i display the metadata information related to a document(Stored in UCM) in a popup in my application...
The user can also update the information through the application.
in my popup i have a trh : table layout in which i have a Select Onechoice field as
<trh:cellFormat id="xcfcSecurityGrp">
<af:selectOneChoice value="#{MetaDataFields.DSecurityGroup}" id="ddldSecurityGroup" showRequired="false"
autoSubmit="true"
immediate="true">
<f:selectItems value="#{ContentDataBean.TSecurityGrpList}" id="si1"/>
</af:selectOneChoice>
</trh:cellFormat>
The MetaDataFields.DSecurityGroup show the current security group on document
and
ContentDataBean.TSecurityGrpList provide the user with the list of security group to update.
The current security group i am getting through a map which consist of metadata information for a document :-
public void setDSecurityGroup(String dSecurityGroup) {
this.dSecurityGroup = dSecurityGroup;
public String getDSecurityGroup() throws IdcClientException, IOException {
Map<String,String> mapValue=ep.getDocumentPropertiesSystem();
dSecurityGroup=mapValue.get("dSecurityGroup");
return dSecurityGroup;
The problem is that whenever i am updating the value for the security group, i am getting the old value, the problem is that i have to every time get value from the map only as it consist metadata information for the current selected document..
Is there is any way through which i can update the value for this field..??
Thanks
JDeveloper - 11.1.1.6.0Hi,
Try binding ValueChangeListener on the selectList. Also set autoSumit property to true.
Thanks,
Pandu -
How to update the value inside a field symbol ?
ASSIGN COMPONENT 'MENGE' OF STRUCTURE <fs_line> TO <fs_field>.
<fs_field> = itab_stpo-menge.
COLLECT <fs_line> INTO <fs_table>.
.processing some code......
ASSIGN COMPONENT 'MENGE' OF STRUCTURE <fs_line> TO <fs_field>.
<fs_field> = ( itab_stpo-menge * itab_plpo-vgw03 ).
COLLECT <fs_line> INTO <fs_table>.
Hi, guys,
May i know is there a way to update the value in inside a field symbol?
I feel hard to figure out the way to solve this situation. Kindly give me some help or perhaos tell me other altenative way to do it also can.
Thanks in advance.
Edited by: Jiansi Lim on Apr 25, 2008 8:09 PMhi check this...
For a structured data object s, you can use the statement
ASSIGN COMPONENT comp OF STRUCTURE s TO FS.
Here the comp is the component name or its index number in the structure.
Find the following sample code -
DATA: BEGIN OF LINE,
COL1 TYPE I VALUE '11',
COL2 TYPE I VALUE '22',
COL3 TYPE I VALUE '33',
END OF LINE.
DATA COMP(5) VALUE 'COL3'.
FIELD-SYMBOLS: <F1>, <F2>, <F3>.
ASSIGN LINE TO <F1>.
ASSIGN COMP TO <F2>.
DO 3 TIMES.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1> TO <F3>.
WRITE <F3>.
ENDDO.
ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>.
WRITE / <F3>.
The output is:
11 22 33
33
I need to update one field in Internal table
regards,
venkat -
How To Update Multi Values In MySQL?
hi there
i have a table of two columns Name,Number
and I Want To Update Both Columns Using Update Sql Query
Is That Possible?It is certainly possible.
Learn SQL. There is a nice SQL tutorial at w3schools.com. Google can find it either.
At least this has nothing to do with JDBC. -
How to update Elements value inside existing xml file
Hi Gurus,
Am somehow new to java and working on xml with java, i have a scenario where i want to update the elements of my existing xml file, i know its possible as i have posted one code on this forum which updates the values of the arrtibutes of existing xml file. Ref :
http://forum.java.sun.com/thread.jsp?forum=34&thread=186091&start=15&range=15&hilite=false&q=
But am not able to use the same code to update the vlaues of the attribute.
if i have this xml file :
<?xml version="1.0"?>
<RootElement>
<Transaction>
<Task9>
<TaskID>Task9</TaskID>
<Description>My Test Case</Description>
<Time>12/12/2004</Time>
</Task9>
</Transaction>
<Transaction>
<Task2>
<TaskID>Task2</TaskID>
<Description>Testing my xml</Description>
<Time>12/12/2004</Time>
</Task2>
</Transaction>
</RootElemen>
Now i want to update teh </Description> and </Time> field using the code that i have given above in the link.
If any one can help me ill really appreciate.The value of an element is stored in a child node of that element. For example, let's say that "e" references the node <Description> then:
e.getFirstChild().getNodeValue() => "My Test Case" -
How to update the value in xml file using transformer after setNodeValue
Hi,
This is my code
I want to set update the values in xml file using transformer..
Any one can help me
This is my Xml file
<?xml version="1.0" encoding="UTF-8"?>
<place>
<name>chennai</name>
</place>
Jsp Page
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="javax.xml.parsers.DocumentBuilderFactory,
javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<% String str="";
String str1="";
try
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
out.println("Before change");
NodeList n11 = doc.getElementsByTagName("name");
Node n22= n11.item(0).getFirstChild();
str1 = n22.getNodeValue();
out.println(str1);
out.println("After change");
String name = "Banglore";
NodeList nlst = doc.getElementsByTagName("name");
Node node= nlst.item(0).getFirstChild();
node.setNodeValue(name);
NodeList n1 = doc.getElementsByTagName("name");
Node n2= n1.item(0).getFirstChild();
str = n2.getNodeValue();
out.println(str);
catch(Exception e)
out.println(e) ;
%>
<h1><%=str%></h1>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
</body>
</html>hi check this exit...
IWO10012 -
How can I get the number of distinct records that each field of a DB table has?
Hi everyone,
I would like to know how to get he number of distinct records that each field of a DB table has. When tracing a SQL statement either in ST12 or ST05, in the plan execution, if the sentence made useage of an index, then I can click in the index name and see this kind of information (no. of distinct values for each field of that index).
Can I do something like this but with the whole fields of a table?
What I have found until now is in Tx ST10; I search for whatever kind of table statistics and then use the function of "Analyze table" (which takes me to Tx DB05). In here, I can enter a table and up to 5 fields in order to get the information that I want.
Is there any other way to do this?
Regards,
David RezaHi David,
You can export the same to excel and sort as per requirement.
Sorry is that what you are looking for ?
Regards,
Deepanshu Sharma
Maybe you are looking for
-
Hello When I want to scan a new document via my HP scanner I unplug my webcam usb cable and reconnect my scanner to my PC.but when I press scan button on my scanner nothing appear(It doesn't start new scan windows) and when I open "windows fax and sc
-
Refresh all worksheet not working in smartview 11.1.2.2.300
Hi All, We have a excelsheet report which contain multiple sheets in it. These all sheets have essbase report using HsGetValue formulas. Now when we are clicking on 'Refresh all worksheet' its not working however single sheet refresh works. Can you a
-
Oracle Access manager 10.1.4 (coreid) multiple authentication for same URL
I am evaluating oracle access manager hence new to this product. I have a requirement where i have a /wps URL. Users coming externally go through reverse proxy server to the final IIS web server. Internal user access IIS directly. /wps should be prot
-
Html report generation save to same VI folder
Hi all, Im creating a sample html report using labview6.1. my question is i want to save my report html file to the current directory where the vi is located instead of giving some path like " C:\Folder1\Folder2\..." etc . My intention is
-
When I open Safari, my home page opens immediately. From there, no other sites will open. The wheel spins, but no other site comes up. I have trashed: com.apple.internetconfigpriv.plist com.apple.internetconfig.plist com.apple.Safari I have emptied t