How to update unique values
I want to update the unique values, if they are not inserted... Please help in this regard
CREATE OR REPLACE PROCEDURE PR IS
lv_operator VARCHAR2(1) := 'N';
TYPE subset_rt IS RECORD
ltt_whse_loc oe_sales_ord_commit.whse_loc%TYPE,
ltt_shape oe_sales_ord_commit.shape%TYPE,
ltt_isize oe_sales_ord_commit.isize%TYPE,
ltt_grade oe_sales_ord_commit.grade%TYPE,
ltt_length oe_sales_ord_commit.length%TYPE,
ltt_pieces NUMBER,
ltt_inv_lbs_commit oe_sales_ord_commit.inv_lbs_commit%TYPE,
ltt_roll_lbs_commit oe_sales_ord_commit.roll_lbs_commit%TYPE,
ltt_ishcom_lbs oe_sales_ord_commit.ishcom_lbs%TYPE);
TYPE subset_aat IS TABLE OF subset_rt
INDEX BY PLS_INTEGER;
aa_subset subset_aat;
errors NUMBER;
dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(dml_errors, -24381);
BEGIN
lv_operator := sy_checkpriv(USER,
'SY_OPERATIONS');
SELECT whse_loc,
shape,
isize,
grade,
length,
0,
inv_lbs_commit,
roll_lbs_commit,
ishcom_lbs
BULK COLLECT INTO aa_subset
FROM oe_sales_ord_commit_temp
WHERE processed_datetime IS NULL
AND username = decode(lv_operator,
'Y',
username,
USER);
BEGIN
FORALL indx IN 1 .. aa_subset.COUNT SAVE EXCEPTIONS
INSERT INTO
(SELECT loc,
shape,
isize,
grade,
length,
pieces,
inv_lbs_commit,
roll_lbs_commit,
ishcom_lbs FROM oe_inventory_temp)
VALUES
aa_subset(indx);
EXCEPTION
WHEN OTHERS THEN
*+<<Trap the rows that have failed due to dup_val_on_index exception and update the inv_lbs_commit,+*
*+roll_lbs_commit, ishcom_lbs columns in oe_inventory_temp table>>+*
-- loc,shape, isize,grade, length, pieces are composite primary keys.
errors := SQL%BULK_EXCEPTIONS.COUNT;
DBMS_OUTPUT.PUT_LINE('Number of statements that failed: ' || errors);
FOR i IN 1..errors LOOP
DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
DBMS_OUTPUT.PUT_LINE('Error message is ' ||
SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
DBMS_OUTPUT.PUT_LINE(aa_subset(SQL%BULK_EXCEPTIONS(i).ERROR_INDEX));
END LOOP;
END;
END PR;
/
Due to the following restriction a number of simple collections is used instead of the collection of records.
[FORALL Statement|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm#sthref2742]: You cannot refer to individual record fields within DML statements called by a FORALL statement. Instead, you can specify the entire record with the SET ROW clause in an UPDATE statement, or the VALUES clause in an INSERT statement.
10g syntax of FORALL statement is used:
SQL> select * from a;
INT DT STR
1 10.02.2009 123
2 11.02.2009 567
SQL> desc a
Name Null? Type
INT NOT NULL NUMBER(38)
DT DATE
STR VARCHAR2(20)
SQL> select * from a;
INT DT STR
1 10.02.2009 123
2 11.02.2009 567
SQL> DECLARE
2 TYPE T_Int_List IS TABLE OF A.Int%TYPE INDEX BY PLS_INTEGER;
3 TYPE T_Dt_List IS TABLE OF A.Dt%TYPE INDEX BY PLS_INTEGER;
4 TYPE T_Str_List IS TABLE OF A.Str%TYPE INDEX BY PLS_INTEGER;
5
6 vInts T_Int_List;
7 vDts T_Dt_List;
8 vStrs T_Str_List;
9
10 eBulk_Error EXCEPTION;
11 PRAGMA EXCEPTION_INIT(eBulk_Error, -24381);
12 BEGIN
13 vInts(1) := 2;
14 vDts(1) := sysdate - 1;
15 vStrs(1) := '888';
16
17 vInts(2) := 3;
18 vDts(2) := sysdate - 22;
19 vStrs(2) := '0000';
20
21 BEGIN
22 FORALL indx IN INDICES OF vInts SAVE EXCEPTIONS
23 INSERT INTO A(Int, Dt, Str)
24 VALUES(vInts(indx), vDts(indx), vStrs(indx));
25 EXCEPTION
26 WHEN eBulk_Error THEN
27 DECLARE
28 vErr_Count INTEGER;
29 vErr_Message VARCHAR2(2000);
30 vErr_Indices T_Int_List;
31 BEGIN
32 vErr_Count := SQL%BULK_EXCEPTIONS.COUNT;
33 -- Getting the indices of rows with duplicate key
34 -- FOR vI IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP - Doesn't work for some reason on 10.2.0.1.0
35 FOR vI IN 1 .. vErr_Count LOOP
36 IF SQL%BULK_EXCEPTIONS(vI).Error_Code <> 1 THEN
37 -- Error other that duplicate key is reraised
38 vErr_Message := SQLERRM(-SQL%BULK_EXCEPTIONS(vI).Error_Code);
39 Raise_Application_Error(-20001, vErr_Message);
40 END IF;
41 vErr_Indices(SQL%BULK_EXCEPTIONS(vI).ERROR_INDEX) := SQL%BULK_EXCEPTIONS(vI).ERROR_INDEX;
42 END LOOP;
43
44 -- Bulk update
45 FORALL vI IN INDICES OF vErr_Indices
46 UPDATE A SET
47 Dt = vDts(vI),
48 Str = vStrs(vI)
49 WHERE Int = vInts(vI);
50 END;
51 END;
52 END;
53 /
PL/SQL procedure successfully completed.
SQL> select * from a;
INT DT STR
1 10.02.2009 123
2 09.02.2009 888
3 19.01.2009 0000Regards,
Dima
Edited by: DimaCit on Feb 10, 2009 10:39 AM
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 -
How to count Unique Values in BEx
Hi Guys,
Can anybody please let me know how to count unique values of a characteristic.
Thanx in advance
PeterI have a similar scenario. If i drill up on the characterstic that had a count of one in each record, the total number of records should be stay equal to the summarised results in the last screen.
Would someone know how to do that .
Arti -
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. -
How to count unique values based on specific criteria
Hello,
I need to count the number of unique values in column A but only if the text in column I is a specific word - how do I do this?Let's say the values are in A1:A10 and they are numeric, and the text is in I1:I10.
As an array formula, confirmed with Ctrl+Shift+Enter:
=SUM(IF(I1:I10="word",1/COUNTIFS(A1:A10,A1:A10,I1:I10,"word")))
where "word" is the specific word you're looking for.
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
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 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 to ensure unique values of all records in the form?
Hi all,
I need to do some personalization in this Oracle EBS Form - Purchasing Super User -> Receiving -> Receipts -> Lot Entry
I must ensure that evry record entered on that form has a unique value in the column Lot Number.
Can anybody advise me please?
Thank you, WillyHi there.
One way to do this is to do a SPQuery and convert it to a datatable using the GetDataTable method and then to a View. The View then has the ability to get unique values using the ToTable method, something like this:
SPList list = SPContext.Current.Web.Lists["MyList"];
SPQuery query = new SPQuery();
query.Query = "<OrderBy><FieldRef Name='Title' /></OrderBy>";
DataTable table = list.GetItems(query).GetDataTable();
DataView v = new DataView(table);
string[] columns = {"Title"};
DataTable tbl = v.ToTable(true, columns);
Hope this helps.
Regards,
Magnus
My blog: InsomniacGeek.com -
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 column value dynamically
Hi All,
I have created a simple mapping and selected insert/update on target table. In target table there is one column record_type which will hold either 'NEW' (if new record is inserting) or 'UPDATED'(if existing record is updating) value. Please let me know how can I do this using OWB PL/SQL map?
Thanks
BhushanHi Sanjaya,
Thank you for your reply.
I like your approch but i think there is need to pass 'UPDATED' when intersect is being used and 'NEW' when minus is being used.
I have developed an OWB map as mentioned in below steps.
1. Chose source (TableA) and target (TableB) as source using table operator.
2. Joined TableA to TableB on col1 using left outer join using joined operator.
3. In expression operator I have calculated value for TableB.col3 using below logic.
CASE WHEN TableB.col1 IS NULL THEN 'NEW' ELSE 'UPDATED' END
4. Mapped columns from expression operator to target table.
I would like to know you comments on above approch. My OWB map has generated below merge statement.
MERGE INTO TableB
USING(SELECT MERGESQL.col1,MERGESQL.col2, CASE WHEN MERGESQL.col3 is null then 'NEW' else 'UPDATED' END col3
FROM (SELECT TableA.col1, TableA.col2,TableB.col1 AS col3
FROM TableA
LEFT OUTER JOIN TableB
ON (TableA.col1 = TableB.col1)) MERGESQL
ON (col1 = MERGESQL.col1)
WHEN NOT MATCHED THEN INSERT(col1,col2,col3) VALUES(MERGESQL.col1,MERGESQL.col2,MERGESQL.col3)
WHEN MATCHED THEN
UPDATE SET col2 = MERGESQL.col2,
col3 = MERGESQL.col3; -
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 generate unique values while initializing values
I am initializing values in my pl/sql program and want to use a sequence to set my unique ids but it errors out. Below is what I use.
ie. table_id := table_seq.nextval;
How can I use my sequence to initialize values or is this possible?The method suggested by user605919 will work. However, you don't need to initialize a variable like this. It is better and more performant to do it like the third example below:
SQL> create table mytable
2 ( id number(6)
3 , description varchar2(30)
4 )
5 /
Tabel is aangemaakt.
SQL> create sequence table_seq start with 1 increment by 1
2 /
Reeks is aangemaakt.
SQL> declare
2 table_id mytable.id%type := table_seq.nextval;
3 begin
4 insert into mytable
5 ( id
6 , description
7 )
8 values
9 ( table_id
10 , 'Some description'
11 );
12 end;
13 /
table_id mytable.id%type := table_seq.nextval;
FOUT in regel 2:
.ORA-06550: line 2, column 41:
PLS-00357: Table,View Or Sequence reference 'TABLE_SEQ.NEXTVAL' not allowed in this context
ORA-06550: line 2, column 12:
PL/SQL: Item ignored
ORA-06550: line 9, column 5:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 9, column 5:
PL/SQL: ORA-00904: "TABLE_ID": invalid identifier
ORA-06550: line 4, column 3:
PL/SQL: SQL Statement ignored
SQL> declare
2 table_id mytable.id%type;
3 begin
4 select table_seq.nextval
5 into table_id
6 from dual
7 ;
8 insert into mytable
9 ( id
10 , description
11 )
12 values
13 ( table_id
14 , 'Some description'
15 );
16 end;
17 /
PL/SQL-procedure is geslaagd.
SQL> begin
2 insert into mytable
3 ( id
4 , description
5 )
6 values
7 ( table_seq.nextval
8 , 'Some description'
9 );
10 end;
11 /
PL/SQL-procedure is geslaagd.And if you need the id value for some code after the insert, you use the RETURNING clause.
Regards,
Rob.
Maybe you are looking for
-
I cannot copy my doc and photos and videos from one external hard drive to a second external hard drive -- both plugged in to my MacBook Air -- I get Error 8062 and the copying (which seemed to be going on for 10 minutes) stops and nothing gets copie
-
In PL-SQL copy a table from one database to another
I am currently working on a VB app where I need a way to archive tables from the running database to an archive database. I was hoping to do this with a stored procedure. Thanks for any suggestions in advance.
-
Fetch websites hosted on Remote IIS server using C#
Hi, I want to get all the websites that are hosted on a remote server. I have the Server IP, username and password of the remote server and I need to retrieve all the sites that are hosted on the server. How can I achieve this in C# ? Regards, Pradee
-
Control multiple apple tv units with 1 remote app
Is it possible to control multiple apple TV units with 1 remote app on an iPhone/iPad? I have apple tv at home, set up under my own personal apple id. I have an apple tv unit at work which I want to use, but that uses our work apple id. can I control
-
how to convert a date in string format to sql date format? thanx in advance