To avoid duplicate values in DrowpDownByIndex
hi
Iam calling an RFC ,it's output is as following
column 1 column2
A 2
A 3
A 42
B 34
B 3
B 11
B 0
Iam displaying these values in two combo box. But my requirement is as following in first combobox if i select A ,only those values in column 2 which are mapped to A ie(2,3,42) should see in the combobox two.So pls help me i don't know how to do this iam a beginner in webdynprofor java.
I'll give points.......
Hi,
You can loop through the node of combo box1:
List attrList = new ArrayList();
IPrivate<VIEW NAME>.I<NODE NAME>Element ele = null;
for(int i = 0;i<wdContext.node<NAME>.size();i++){
if(wdContext.node<NAME>().get<NAME>elementAt(i).get<ATTR_NAME1>().startWith("A")){
// ATTR_NAME1 is the attribute mapped to checkbox1.
// create element of another attribute which should be mapped to checkbox2.
ele = wdContext.create<NODE NAME>Element();
ele.set<ATTR NAME2>(wdContext.node<NAME>().get<NAME>elementAt(i).get<ATTR_NAME1>());
// ATTR_NAME1 is the attribute mapped to checkbox1.
attrList.add(ele);
wdContext.node<NAME>.bind(attrList);
Hope this will solve your problem.
thanks & regards,
Manoj
Similar Messages
-
How to avoid duplicates values from alvgird see below code
how to avoid duplicates values from alvgird see below code
in below query docno no is repeated again and again
how i can avoid duplication in this query.
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.Hi Laxman,
after that select statement
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.
<b>if sy-subrc = 0.
delete adjucent duplicates from itab comparing <field name of itab internal table>
endif.</b>
this will delete your duplicate entries.once you done with this call the alv FM.
<b> call function 'REUSE_ALV_GRID_DISPLAY'</b>
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'IT_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = 'Purchase Order Details'
I_GRID_SETTINGS = I_GRID_SETTINGS
is_layout = wa_layout
it_fieldcat = it_fieldcat
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
it_sort = it_sort
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
it_events = it_event
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
<b> t_outtab = ITAB</b>
exceptions
program_error = 1
others = 2
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Thanks
Vikranth Khimavath -
Avoid duplicate values in a row!
Hi,
I posted this query few days back and got the response to .. but now i am facing a new problem in this.. so let me explain this again,
I have a table A as follows
TableA
ID data1 data2
1 aa zz
1 bb xx
1 cc yy
1 aa yy
1 bb zz
When i select data1 ColumnA, data2 ColumnB from TableA,
I need it to be displayed in single row seperated by comma, is their any way to do it....
ColumnA ColumnB
aa,bb,cc zz,xx,yy
So i got a response to use one of the technique suggested by,
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
I used the following function to achieve it..
CREATE OR REPLACE FUNCTION get_data (p_id in tableA.id%TYPE)
RETURN VARCHAR2
IS
l_text VARCHAR2(32767) := NULL;
BEGIN
FOR cur_rec IN (SELECT data1 FROM tableA WHERE id = p_id) LOOP
l_text := l_text || ',' || cur_rec.data1;
END LOOP;
RETURN LTRIM(l_text, ',');
END;
The above function works .. brings all the data in the column in a single line.. but.. it has duplicates in that row.. how to avoid the duplicates it..
i am getting OUTPUT as
columnA ColumnB
aa,bb,cc,aa,bb zz,xx,yy,yy,zz
but i need it as follows
ColumnA ColumnB
aa,bb,cc zz,xx,yy
How to avoid those duplicate values.. could some one help me around
Thanks in advance
-PreethaMay be this can give you an idea to customize it for you!
http://www.williamrobertson.pwp.blueyonder.co.uk/documents/one_row.html
Sorry! I didn't know! It is the same example that is referred in both the links!
Cheers
Sarma.
Message was edited by:
Radhakrishna Sarma -
How to avoid Duplicate values in Oracle forms
Hello Everyone,
I am new to Oracle forms, working on Oracle Applications : 12.1.2,
Here I have a form Receiving Transactions,
in that I have Lot_Number and quantity columns.
The purchased items need to be stored in Lot number.
If 100 quantities purchased then 100 quantities can be stored in single lot number
i.e
Lot_Number Qty
001 100or 100 quantities can be stored in different lot numbers.
i.e
Lot_Number Qty
001 50
002 50(The qty may differ)but not like the following,
Lot_Number Qty
001 50
001 50.For second line,If they selected same lot number as First lot number,
The error message has to be shown as "Lot number duplicated,Select Different Lot number or update the full qty in original line".
Can anyone help me to solve this.
Thank you.
Regards,
GurujothiHi François Degrelle,
I added the following Plsql in the 'When-validate-Item' block,
declare
l_current_number varchar2(80);
begin
l_current_number := :lot_entry.lot_number;
first_record;
loop
if l_current_number = :lot_entry.lot_number then
message ('Duplicate');
end if;
next_record;
end loop;Its started to check from First record itself and giving the message 'Duplicate',
How to check from second record?
when the first record is entered it should not check when the second record is entered it should compare with the First record value and if it is same then it should give message as 'Duplicate'.
Thank you. -
Avoiding Duplicate Values Using LOV
Hi
I have the following code in WHEN_VALIDATE_ITEM trigger on a text item named REASON_ID.
------------------xxxxxxxxx--------------------------------
DECLARE
rg_id RecordGroup;
rec_count NUMBER;
BEGIN
-- Get the record group ID --
rg_id := Find_Group( 'REASONS_RG' );
-- Get the number of rows --
rec_Count := Get_Group_Row_Count( rg_id );
-- delete the selected row --
FOR j IN 1..rec_Count LOOP
If Get_Group_Number_Cell( 'REASONS_RG.ID', j ) = :PREF_REASONS_TO_JOIN.REASON_ID Then
Delete_Group_Row( rg_id, j );
exit ;
End if ;
END LOOP;
END;
-------------------------xxxxxxxxxxxxxx----------------------
Record Group REASONS_RG exists and contains ID in the SELECT statement.
LOV REASONS_LOV is working fine as expected.
Now When I click on this item REASONS_ID, LOV is displayed automatically and I select the record that I want. Then I press enter to change record and make another selection. This trigger should prevent me from selecting the same record twice (it should actually remove that record to be displayed in the LOV) right? But it doesn't work. I can still select the same record.
Can anyone help me with this please?
I got the above trigger code from this forum only and I guess many people have tried it and were able to restrict duplicates. I dont know what I am doing wrong here.
Thanks in advanceHello,
Yes, the automatic refresh must be set to NO, else, the record group is re-populated each time.
Francois -
Avoiding null and duplicate values using model clause
Hi,
I am trying to use model clause to get comma seperated list of data : following is the scenario:
testuser>select * from test1;
ID VALUE
1 Value1
2 Value2
3 Value3
4 Value4
5 Value4
6
7 value5
8
8 rows selected.
the query I have is:
testuser>with src as (
2 select distinct id,value
3 from test1
4 ),
5 t as (
6 select distinct substr(value,2) value
7 from src
8 model
9 ignore nav
10 dimension by (id)
11 measures (cast(value as varchar2(100)) value)
12 rules
13 (
14 value[any] order by id =
15 value[cv()-1] || ',' || value[cv()]
16 )
17 )
18 select max(value) oneline
19 from t;
ONELINE
Value1,Value2,Value3,Value4,Value4,,value5,
what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
thanks,
Edited by: orausern on Feb 19, 2010 5:05 AMHi,
Try this code.
with
t as ( select substr(value,2)value,ind
from test1
model
ignore nav
dimension by (id)
measures (cast(value as varchar2(100)) value, 0 ind)
rules
( ind[any]= instr(value[cv()-1],value[cv()]),
value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
and ind[cv()]=0 THEN ',' || value[cv()] END
select max(value) oneline
from t;
SQL> select * from test1;
ID VALUE
1 Value1
2 Value2
3 Value3
4 Value4
5 Value4
6
7 value5
8
8 ligne(s) sélectionnée(s).
SQL> with
2 t as ( select substr(value,2)value,ind
3 from test1
4 model
5 ignore nav
6 dimension by (id)
7 measures (cast(value as varchar2(100)) value, 0 ind)
8 rules
9 ( ind[any]= instr(value[cv()-1],value[cv()]),
10 value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
11 and ind[cv()]=0 THEN ',' || value[cv()] END
12 )
13 )
14 select max(value) oneline
15 from t;
ONELINE
Value1,Value2,Value3,Value4,value5
SQL> -
i have one database table called "sms1" that table is updated every day or on daily basis it has the following fields in it:
SQL> desc sms1;
Name Null? Type
MOBILE NUMBER
RCSTCNATCNATCNATCNAWTHER VARCHAR2(39 CHAR)
SNO NUMBER
INDATE DATE
From this table the is one column "RCSTCNATCNATCNATCNAWTHER VARCHAR2(39 CHAR)" . I am splitting it into different columns like :
SQL> desc smssplit;
Name Null? Type
R VARCHAR2(2 CHAR)
C VARCHAR2(2 CHAR)
S VARCHAR2(1 CHAR)
TC VARCHAR2(3 CHAR)
NA VARCHAR2(3 CHAR)
TC2 VARCHAR2(3 CHAR)
NA2 VARCHAR2(3 CHAR)
TC3 VARCHAR2(3 CHAR)
NA3 VARCHAR2(3 CHAR)
TC4 VARCHAR2(3 CHAR)
NA4 VARCHAR2(3 CHAR)
WTHER VARCHAR2(10 CHAR)
SNO NUMBER
INSERTDATA VARCHAR2(25 CHAR)
Now I am written a procedure to insert the data from "Sms1" table to smssplit table...
CREATE OR REPLACE PROCEDURE SPLITSMS
AS
BEGIN
INSERT INTO scott.SMSSPLIT ( R,C,S,TC,NA,TC2,NA2,TC3,NA3,TC4,NA4,WTHER,SNO)
SELECT SUBSTR(RCSTCNATCNATCNATCNAWTHER,1,2) R,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,3,2) C,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,5,1) S,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,6,3) TC,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,9,3) NA,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,12,3) TC2,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,15,3) NA2,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,18,3) TC3,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,21,3) NA3,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,24,3) TC4,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,27,3) NA4,
SUBSTR(RCSTCNATCNATCNATCNAWTHER,30,10) WTHER, SNO
FROM scott.SMS1 where SNO=(select MAX (sno) from SMS1);
END;
Now in order to update the second table with data from first table on regular basis I have written a job scheduler and I am using oracle 9.0. version...
DECLARE
X NUMBER;
JobNumber NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
job => X
,what => 'scott.SPLITSMS;'
,next_date => SYSDATE+1/1440
,interval => 'SYSDATE+1/1440 '
,no_parse => FALSE
:JobNumber := to_char(X);
END;
Now this job scheduler is working properly and updating the data for every one minute but it is taking or updating the duplicate values also ..like example:
R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
INSERTDATA
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:49:16
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:49:16
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:50:17
R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
INSERTDATA
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:50:17
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:51:19
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:51:19
R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
INSERTDATA
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:52:20
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:52:20
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:53:22
R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
INSERTDATA
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:53:22
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:54:45
33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
06-SEP-2012 03:54:45
Now I do not want the duplicate values to be updated ...and want them to ignore them.....
please I need a help on this query........How to avoid the duplicate values............Look at the posts closely:might not be needed if formatted ;)
create or replace procedure splitsms as
begin
insert into scott.smssplit (r,c,s,tc,na,tc2,na2,tc3,na3,tc4,na4,wther,sno)
select substr(rcstcnatcnatcnatcnawther,1,2) r,
substr(rcstcnatcnatcnatcnawther,3,2) c,
substr(rcstcnatcnatcnatcnawther,5,1) s,
substr(rcstcnatcnatcnatcnawther,6,3) tc,
substr(rcstcnatcnatcnatcnawther,9,3) na,
substr(rcstcnatcnatcnatcnawther,12,3) tc2,
substr(rcstcnatcnatcnatcnawther,15,3) na2,
substr(rcstcnatcnatcnatcnawther,18,3) tc3,
substr(rcstcnatcnatcnatcnawther,21,3) na3,
substr(rcstcnatcnatcnatcnawther,24,3) tc4,
substr(rcstcnatcnatcnatcnawther,27,3) na4,
substr(rcstcnatcnatcnatcnawther,30,10) wther,
sno
from scott.sms1 a
where sno = (select max(sno)
from sms1
where sno != a.sno
); ---------------> added where clause with table alias.
end;Regards
Etbin -
How to restrict the duplicate values in lov column of VO based Adv Table
Hi Gurus,
I want to restrict the duplicate values at lov which is a colunm in an Adv Table.
If user enters duplicate values then first it should show an error msg that Duplicate values have been entered.
After the duplicate values have been removed, then the user can save all the values in the table.
My Adv Table is based on a VO.
The link how to restrict the duplicate values at form level
talks about Adv Table based on a EoVO, which doesnot work in my case.
My Approach,
I am iterating through RowSetIterator and committing through PROCEDURE.
I am able to avoid duplicate entry through a function checkRespId. (given below)
Below code is for iterating and committing.
public void saveline(String reqid,String userid)
System.out.println("RequestId/saveline"+reqid);
System.out.println("UserId/saveline"+userid);
OAViewObject vo = (OAViewObject)getRespLineVO1();
RespLineVORowImpl row = null;
int fetchedRowCount = vo.getFetchedRowCount();
RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
if (fetchedRowCount > 0)
deleteIter.setRangeStart(0);
deleteIter.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
System.out.println("Inside the for LOOP");
row = (RespLineVORowImpl)deleteIter.getRowAtRangeIndex(i);
String respoidid = row.getAttribute("ResponsibilityId")+"";
String respname = row.getAttribute("ResponsibilityName")+"";
String stdate = row.getAttribute("StartDate")+"";
String enddate = row.getAttribute("EndDate")+"";
String linestatus ="A";
if(userid!=null)
if(!(respoidid.equals("null")) && respoidid!=null)
String checkingrespid=null;
checkingrespid = checkRespId(userid,respoidid);+contains no if not duplicate and yes if its duplicate+
System.out.println("checkingrespid for Resp with ID :"+respoidid+"exists or not "+checkingrespid);
if(checkingrespid.equals("No"))
String message, result = null;
Connection txn = getOADBTransaction().getJdbcConnection();
try
calling PROC ...
catch(Exception e)
message = "Error in Inserting into line" + e;
throw new OAException(message, OAException.ERROR);
else
throw new OAException("You have entered duplicate no. of values", OAException.ERROR);
else
System.out.println("respoidid is null");
break;
deleteIter.closeRowSetIterator();
public String checkRespId(String userid,String respoidid)
String createRow="No";
OAViewObject vo = (OAViewObject)findViewObject("CheckRespVO1");
if (vo != null)
vo.setWhereClauseParams(null);
vo.setWhereClauseParam(0, userid);
vo.setWhereClauseParam(1, respoidid);
vo.executeQuery();
System.out.println("ROW COUNT IS "+vo.getRowCount());
if(vo.getRowCount()>0)
createRow="Yes";
else
createRow="No";
return createRow;
Problem:
I remove the duplicate entries and click on save and get this error.
Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user.
\nAction: Cancel the transaction and re-query the record to get the new data.
Thanks,
SombitHi Anil,
I am trying out your code but stuck in inserting the rows
using your code in URL: http://oracleanil.blogspot.com/2010/09/oaf-passing-table-type-object-to-oracle.html
I am always getting the same exception i.e COde blast in when I run.
My modified code is:
String[] as = null;
Number[] vNumber = null;
Number[] vNumberrespid = null;
Number reqidnumber = null;
reqidnumber = new Number(Integer.parseInt(reqid));
Connection txn = getOADBTransaction().getJdbcConnection();
String mCreateSearchRequestStatement = null;
OAViewObject vo = (OAViewObject)findViewObject("RespLineVO1");
int j = vo.getFetchedRowCount();
try
System.out.println("abouce try");
vo.reset();
if (vo.getFetchedRowCount() > 0)
System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
int i = 0;
as = new String[j];
vNumber = new Number[j];
vNumberrespid = new Number[j];
while (vo.hasNext())
vo.next();
System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));
vNumber[i] = (reqidnumber);
vNumberrespid = ((Number)vo.getCurrentRow().getAttribute("ResponsibilityId"));
as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ResponsibilityName")).concat(String.valueOf(""));
System.out.println("Request ID "+reqidnumber[i]);//getting null even there is some value selected
System.out.println("ResponsibilityId "+vNumberrespid[i]);//getting null even there is some value selected
System.out.println("Resp Name "+as[i] );//getting null even there is some value selected
i++;
CallableStatement cs = txn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2,:3)}");
ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumber);
ARRAY arraynew = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumberrespid);
ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", txn), txn, as);
cs.setArray(1, array);
cs.setArray(2, arraynew);
cs.setArray(3, array1);
cs.registerOutParameter(3, 2003, "JTF_VARCHAR2_TABLE_100");
cs.execute();
ARRAY error = null;
error = (ARRAY)cs.getArray(2);
if ((error != null) && (error.length() > 0))
System.out.println(String.valueOf("Error is ").concat(String.valueOf(error.getArray())));
String[] retError = new String[j];
retError = (String[])error.getArray();
System.out.println(String.valueOf("Error in saving data").concat(String.valueOf(retError[0])));
cs.close();
catch (Exception exception)
throw new OAException("code blast", OAException.ERROR);
Thanks,
Sombit -
Lookup transformation to avoid duplicate rows? - SSIS 2005
Hi,
I'm maintaning a SSIS 2005 pkg. I need to read a flat file to write on a SQL Server table, avoiding duplicates.
I can have duplicates rows into the flat file to import and I need to prevent the insert of any rows already existing in the SQL Server table.
So, I think to use a lookup transformation. I've created a flat file source, then I connect it to a lookup transformation and inside it I've specified as the reference table the SQL Server destination table. Then, I've checked the available lookup columns
each adding as a new column: but the lookup task has arised an error and so I've specified as lookup operation the replacement. For each unmatching I need to write on the SQL Server table (the reference table in the lookup). For the lookup output error I've
indicate to ignore failure. Other steps?
However, when I run the pkg then inside the SQL Server destination table I can see only NULL values, but I want to see the rows don't already present in the table.
Any suggests to me, please? ThanksHi,
I'm using SSIS 2005 as reported in the title of the post.
I could have duplicates inside the source file and the existing table could haven't any rows.
Thanks
If you dont have any rows in existing table, then they will go through Error output in lookup task. For duplicates, lookup task will find matches and will go through lookup match output
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
To avoid duplicate entries in multi row
Hi i need to avoid duplicate entries in multi record form.In the master block i have AGENCY CODE.These are the fields, RATING_CODE(composite primary key alng with AGENCY_CODE in the detail block,but set as hidden) and DESCRIPTION
in the detail block.If AGENCY_CODE is CRISIL,then for that i should not enter duplicate RATING CODES.I have written
DECLARE
L_COUNT2 NUMBER;
l_ret varchar2(20);
BEGIN
SELECT COUNT(*) INTO L_COUNT2 FROM CSTM_AGENCY_CODE_DETAIL
WHERE AGENCY_CODE=:BLK_CSTM_AGENCY_CODE_DETAIL.AGENCY_CODE
AND RATING_CODE=:BLK_CSTM_AGENCY_CODE_DETAIL.RATING_CODE;
IF L_COUNT2 > 0 THEN
l_ret := ovpkcs.fn_dispmsg('AGYCOD-03;',';',';');
Raise Form_Trigger_Failure;
END IF;
END;
in WHEN_VALIDATE_ITEM.
Now when i press the TAB to move next time it gives the message,DUPLICATE RATING CODE.The
problem is when i move back to the previous record by clicking mouse and change it to the already existing value,and while i save the validation is not happening and the message is not shown.Kindly tell me where i should code.
Thank youhy,
you can check whan commit( an save button)
for i = 1 to n-1
check condition (item = item +1)
next_record
end
or by stored insert whit exception return to form program when duplicate key is found
... -
Avoid repeating values in details section
Hi,
I have a report with a lot of formulas - depending on certain values in a certain Oracle database table values are summed up.
The fields are therefore placed in the report footer.
As I now have to insert a grouping I need to move the fields into the details section. However, I don't want to display each value there but only the sum - I would like to avoid repeating values in the details section.
A formula looks like this:
stringvar A1;
if {OUR_TABLE_FIELD} = 1 then A1 := {OTHER_TABLE.OTHER_FIELD}
Else A1:=A1;
A1;
Thanks!Add a suitable group and then display data in this group footer, suppress detail section. It will effectively show the last detail line and thus eliminate duplicates from view. However, data is still there so if you want to use summaries you will need to use Running totals to ensure duplicates are not counted/summed
Ian -
hi,
i want to print distinct value
example data is given below :
Jv.No hl.no col1 col2 col3 col4 col5
1 a12 xx yy zz 11 21
b23 xx yy zz 11 21
actuallly i m not printig the hl.no in his report , for u r reference i will show to u
col1 to col 5 values printing based on the serial
jval , jserial two columns
i am writing the code in formula column
if jserial=1 then
print jval ( for that serial wat value is stored in the table that should return)
like upto serial 5 should print
col1 to col5 all the values are same only it should print distinct value
like this
Jv.No col1 col2 col3 col4 col5
1 xx yy zz 11 21
otherwise any one value is varrying as usaualawahtever is there that only print
Jv.No col1 col2 col3 col4 col5
1 xx yy zz 11 21
xx yy zz 154 21
need o/p like this :
Jv.No col1 col2 col3 col4 col5
1 xx yy zz 11 21
xx yy zz 154 21hi,
job no mblno carrier vsl voy lport dport
111 2000 misc hanjin 12E sl UK
misc hanjin 12E sl UK
job no & mbol no is one group
remainings values another group.
carrier , vsl , voy , lport,dport these values fetches from the column of JOB_DESC
data's strored in the table like this:
jobparent Job desc jobserial
1 misc 1
1 hanjin 2
1 12E 3
1 sl 4
1 UK 5
2 misc 1
2 hanjin 2
2 12E 3
2 sl 4
2 UK 5
i am writing the formula column in the datamodel of second group.
if jobserial = 1 then print the value of Misc in carrier , job_serial=2 then print the value of Hanjin into vsl column.
i need to avoid the duplicate value :
job no mblno carrier vsl voy lport dport
111 2000 misc hanjin 12E sl UK
misc hanjin 12E sl UK -- This line not required
suppose carrier,voy or any one value is different then i need to print all the data
job no mblno carrier vsl voy lport dport
111 2000 misc hanjin 12E sl UK
ABCc hanjin 34D sl UK -
Function module to avoid duplicates in seacrch help through search helpexit
Hi all,
I have created composite seacrh help using 2 search helps( i have craeated search helps through se11).
now after i execute my program and press f4 , it is giving duplicate values( repeated values in my list if i press f4 )
I came to know that i can avoid duplicates if i call cooreesponding function module in seacrh help exit ( we can find this tab in se11 screens )
Can you please help me in knowing the standard function module to avoid duplicates in seacrh help through seacrh help exit ?
Thank u vry much in advance...Hi,
check this thread
[Thread|http://www.sapfans.com/forums/viewtopic.php?f=13&t=313139]
Also check this FM C140_DELETE_DUPLICATES
Rhea.
Edited by: rhea on Dec 2, 2008 9:31 AM -
How to set collapsespecification to avoid duplicates in Search Results
can someone help me How to set collapsespecification to avoid duplicates in OOTB Search Results page.
Suresh Kumar Udatha.Export the content search webpart you will download the .webpart file you will find the below property
<property name="DataProviderJSON" type="string">{"QueryGroupName":"Default","QueryPropertiesTemplateUrl":"sitesearch://webroot","IgnoreQueryPropertiesTemplateUrl":false,"SourceID":"8413cd39-2156-4e00-b54d-11efd9abdb89","SourceName":"Local SharePoint Results","SourceLevel":"Ssa","CollapseSpecification":"","QueryTemplate":"(contentclass:STS_ListItem OR IsDocument:True)","FallbackSort":[{"d":1,"p":"ViewsLifeTime"}],"FallbackSortJson":"[{\"d\":1,\"p\":\"ViewsLifeTime\"}]","RankRules":null,"RankRulesJson":"null","AsynchronousResultRetrieval":false,"SendContentBeforeQuery":true,"BatchClientQuery":true,"FallbackLanguage":-1,"FallbackRankingModelID":"","EnableStemming":true,"EnablePhonetic":false,"EnableNicknames":false,"EnableInterleaving":false,"EnableQueryRules":true,"EnableOrderingHitHighlightedProperty":false,"HitHighlightedMultivaluePropertyLimit":-1,"IgnoreContextualScope":true,"ScopeResultsToCurrentSite":false,"TrimDuplicates":false,"Properties":{"TryCache":true,"Scope":"{Site.URL}","ListId":"dd8de50c-d533-4667-9cad-79e4402d5435","ListItemId":1,"UpdateLinksForCatalogItems":true,"EnableStacking":true},"PropertiesJson":"{\"TryCache\":true,\"Scope\":\"{Site.URL}\",\"ListId\":\"dd8de50c-d533-4667-9cad-79e4402d5435\",\"ListItemId\":1,\"UpdateLinksForCatalogItems\":true,\"EnableStacking\":true}","ClientType":"ContentSearchRegular","UpdateAjaxNavigate":true,"SummaryLength":180,"DesiredSnippetLength":90,"PersonalizedQuery":false,"FallbackRefinementFilters":null,"IgnoreStaleServerQuery":false,"RenderTemplateId":"DefaultDataProvider","AlternateErrorMessage":null,"Title":""}</property>
update the collapse specification value (currently empty string) then upload the webpart
Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010 -
How to rewrite this query to avoid duplicates , please
Hello Good Morning All,
Happy New Year,
Could you please help to rewrite the below two queries (so that i can avoid duplicates) i need to send email to everyone not the dupllicated ones), please?
Create table #MyPhoneList
AccountID int,
EmailWork varchar(50),
EmailHome varchar(50),
EmailOther varchar(50),
IsOffersToWorkEmail bit,
IsOffersToHomeEmail bit,
IsOffersToOtherEmail bit,
IsValidEmailWork bit,
IsValidEmailHome bit,
IsValidEmailOther bit
--> In this table AccountID is uniquee
--> email values could be null or repetetive for work / home / Other (same email can be used more than one columns for accountid)
-- a new column will be created with name as Sourceflag( the value could be work, Home, Other depend on email coming from) then removes duplicates
SELECT AccountID , Email, SourceFlag, ROW_NUMBER() OVER(PARTITION BY AccountID, Email ORDER BY Sourceflag desc) AS ROW
INTO #List
from (
SELECT AccountID
, EmailWork AS EMAIL
, 'Work' AS SourceFlag
FROM #MyPhoneList (NoLock) eml
WHERE IsOffersToWorkEmail = 1
AND EMAILWORK IS NOT NULL
AND IsValidEmailWork = 1
UNION
SELECT AccountID
, EmailHome
, 'Home' AS SourceFlag
FROM #MyPhoneList (NoLock) eml
WHERE IsOffersToHomeEmail = 1
AND EMAILHOME IS NOT NULL
AND IsValidEmailHome = 1
UNION
SELECT AccountID
, EmailOther
, 'Other' AS Sourceflag
FROM #MyPhoneList (NoLock) eml
WHERE EmailOther = 1
AND EMAILOther IS NOT NULL
AND IsValidEmailOther = 1
) eml --select count(*) from #email
--Email dedupe on source
SELECT * INTO #distinct FROM #List WHERE ROW = 1
Thank you in Advance
MilanPlease follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for:
https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
>> Could you please help to rewrite the below two queries (so that I can avoid duplicates) I need to send email to everyone not the duplicated ones), please? <<
This mess is not a table because it has no keys, not way to have a key. You are using UNION like we used punch card merges in the o9ld days.
What math do you do on the account_id? That is the only reason that you use numeric values Why do you think that an email is fifty characters long? Yes, most them are, but did you bother to look at the maximum length? NO! Why did you name it “Phone_List” when
it is nothing but email addresses? emails are not phones.
Please read this article so you will know why RDBMS does not use assembly language flags like you are doing.
https://www.simple-talk.com/sql/t-sql-programming/bit-of-a-problem/
It would also help if you know what normalization was. Here is one design that is valid.
CREATE TABLE Something_emails
(account_id CHAR(15) NOT NULL,
email_address VARCHAR(256) NOT NULL,
email_type CHAR(5) NOT NULL
CHECK (email_type IN ('home', 'work', 'misc')),
PRIMARY KEY (email_address, email_type)
>> In this table account_id is unique <<
No, not without the DDL you did not post.
>> email values could be NULL or repetitive for work / home / Other (same email can be used more than one columns for account_id) <<
Not a problem. Look at the primary key. Also why would anyone store invalid data in a table? SQL programmers try to keep it out!
>> a new column will be created with name as Source_flag (the value could be work, Home, Other depend on email coming from) then removes duplicates <<
More kludges! Oh, putting the comma at the front of a line is how non-SQL mimic punch cards. An SQL progtrqammer would put related subsets of columns on one line – we think in sets! After 30+ years of SQL, this is one of the code smells I use to find bad
code.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Maybe you are looking for
-
What are the names of the servers of "Yahoo!"?
Hi everybody! I would like to use Mail to access my yahoo! e-mail account and they ask me to set up the incoming and outcoming servers. The problem is that I don't know for sure what I must enter in the spaces... Could somebody who has already done t
-
Windows 2008 Licensing - Standard and Enterprise Edt - No of License required
Hello All , We have a Windows Environment running on VMware (ESXi5.1), running Windows 2008 Standard and Enterprise platforms . We are working on the no of license that is required for each category . Can you help us in licencing calculation for e
-
SCCM 2012 DP "starting to process content"
Hi All I am stuck with a problem in SCCM 2012. It is unable to distribute newly packaged content. The DP just says "starting to process content" and doesnt change. I have removed the DP from the server and re-added it. Reinstalled IIS Recreated the p
-
Internal error (3006) occurred
We have formatted searches on user-defined fields When I run the query associated with that formatted search from the menu, it runs just fine: But when I run the formatted search from within the form (single mouse click on litte magnifying glass icon
-
Extract information from string
hi, I am working on complex number and i stuck on phase.. i have string which contains "+2.0+ -0.3I" and i want to extract real and img part. how should i do that one... i tried parse.compile.split but it's not working and reg ex for above string i a