Prevent duplicate value being entered into a column
How do we prevent user to enter duplicate value into one of the column of a multiple record block before we commit the form ?
Can anybody help ?
Thanks,
Shu Wen
Do you want the duplicate to be detected as soon as the item is validated ?
If so, the only way I have found to do so is to maintain a copy of the contents of the block in a record group. Rather cumbersome and a few triggers needed, but I have one application where I had to do it. I have always found it restrictive that you cannot read values from other records without navigating to them. If anyone has found a better method I would be interested to hear.
Similar Messages
-
Hi all,
I have created a form with one data block MATURED_FD_DTL which looks like below:
ACCT_FD_NO
CUST_CODE
FD_AMT
FD_INT_BAL
TDS
CHQ_NO
ADD_FD_AMT
P_SAP_CODE
P_TYPE
CREATE TABLE MATURED_FD_DTL
ACCT_FD_NO VARCHAR2(17 BYTE) NOT NULL,
CUST_CODE NUMBER(9),
FD_AMT NUMBER(15),
FD_INT_BAL NUMBER(15),
TDS NUMBER(15),
CHQ_NO NUMBER(10),
ADD_FD_AMT NUMBER(15),
P_SAP_CODE NUMBER(10),
P_TYPE VARCHAR2(1 BYTE)
For MATURED_FD_DT.ACCT_FD_NO, Trigger: KEY_NEXT_ITEM, I have written the following code:
DECLARE
V1 NUMBER;
V2 NUMBER;
BEGIN
V1:=:MATURED_FD_DTL.ACCT_FD_NO;
MESSAGE('V1:'||V1);
MESSAGE(' ');
END;
GO_ITEM('MATURED_FD_DTL.CUST_CODE');
This is just a dummy code.
When ever i enter the value in the field of ACCT_FD_NO, it pops up a message saying "V1:Value of ACCT_FD_NO",
So i want to store that value .
Compare them & if it is egual, it should pop up a message saying duplicate value is entered and must not allow to enter, at form_level.
So how can I compare the ACCT_FD_NO value between FIRST_RECORD and NEXT_RECORD ??
Help Me .
Thank You.
Oracle Forms 6i.
Oracle 9i.Thank You HamidHelal.
Actually before posting the code, I went through the first link you have mentioned. I tried also, it is quite tedious procedure, however i dint get the proper result, may be i have done some mistake. Anyways , can you tell me how do i check in database table, if a value exists OR IF VALUE FOUND & then message and raise form trigger failure; something like below.
IF :MATURED_FD_DTL.ACCT_FD_NO EXISTS
THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
MESSAGE(' ');
RAISE FORM_TRIGGER_FAILURE;
END;
OR
IF :MATURED_FD_DTL.ACCT_FD_NO FOUND
THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
MESSAGE(' ');
RAISE FORM_TRIGGER_FAILURE;
END;
Is there any equivalent in the form in oracle forms 6i?? Please let me know how do i do this?? -
Prevent data from being loaded into certain dimensions
Is there any way to prevent data from being loaded into certain dimensions? For example, if I have 2 dimensions: Scenario and Date, I only want a given Scenario to accept data in certain date ranges.
Thanks,
JasonI'll assume you mean by load rules. If you are talking about sending data from Excel, then the first one only is the answer.
There are two ways I can think of doing this.
1. create filters with write access to certain intersections and use an Id associated to that filter to load the data
2. Use selection/rejection criteria in the load rule to limit what can be loaded
As a bonus
3. If you are using SQL interface loads, set up a table with what data is allowed to be leded. -
Select List to check duplicate values before putting into another item
Hi All ,
I have a select list which contains .. country regions like ( APAC , EMEA etc ) .
When I select any region , all the countries belonging to the region fills in another item .
Suppose I select APAC , all the countries like India , Japan etc all fills in another item .
But the problem is , if I select twice APAC , it fills duplicate values . Its filling duplicate values .
I want to put validation or check for country value ...
Suppose I select ' APAC ' it fills all APAC countries in another item . Now Again If I select APAC then it first check the item whether the country is there or not . If already APAC countries are there in the Item then it will show an error message that " Value already Exist ' .
I am not able to fix this problem . it is creating duplicate values in database table .
Please some one help me on this ..
Thanks
PrashantPatrick ,
Sorry , I am correcting my words ..
I am using Multiselect List ( P11_REGION) having regions APAC , EMEA , LAD etc .
When I select Region like APAC , it fills all the countries of APAC and puts into a List .
If again I select APAC , it again fills all the APAC countries and puts into a list which causes duplicacy .
I have one Application Process which returns Country according to Region selection and puts in the list .
So , what i want is when user twice selects region APAC , it searches the list whether APAC countries are there or not . If countries are already exists then it show an error otherwise Puts the countries in the list . -
Split one column value and insert into multiple columns
hi
am new to plsql .
i want to split a characters from one column and insert into multiple columns
i tried used substr function the symbol ',' vary his place dynamically ,so i can't apply substr function.
for eg: before split
col1 :
col2 :
col3 :
col4 :
colu5: adsdf,fgrty,erfth,oiunth,okujt
after split
col1 :adsd
col2 :fgrty
col3 :erfth
col4 :oiunth
col5 : adsdf,fgrty,erfth,oiunth,okujt
can anyone help me
thanks
Edited by: 800324 on Dec 23, 2010 8:28 AM
Edited by: 800324 on Dec 23, 2010 8:36 AMHow about:
SQL> create table t
2 (col1 varchar2(30)
3 ,col2 varchar2(30)
4 ,col3 varchar2(30)
5 ,col4 varchar2(30)
6 ,col5 varchar2(30)
7 );
Table created.
SQL> insert into t (col5) values ('adsdf,fgrty,erfth,oiunth,okujt');
1 row created.
SQL> insert into t (col5) values ('x,y');
1 row created.
SQL> insert into t (col5) values ('a,b,c,d');
1 row created.
SQL> select * from t;
COL1 COL2 COL3 COL4 COL5
adsdf,fgrty,erfth,oiunth,okujt
x,y
a,b,c,d
3 rows selected.
SQL>
SQL> merge into t a
2 using ( with t1 as ( select col5||',' col5
3 from t
4 )
5 select substr(col5, 1, instr(col5, ',', 1, 1)-1) col1
6 , substr(col5, instr(col5, ',', 1, 1)+1, instr(col5, ',', 1, 2)- instr(col5, ',', 1, 1)-1) col2
7 , substr(col5, instr(col5, ',', 1, 2)+1, instr(col5, ',', 1, 3)- instr(col5, ',', 1, 2)-1) col3
8 , substr(col5, instr(col5, ',', 1, 3)+1, instr(col5, ',', 1, 4)- instr(col5, ',', 1, 3)-1) col4
9 , rtrim(col5, ',') col5
10 from t1
11 ) b
12 on ( a.col5 = b.col5 )
13 when matched then update set a.col1 = b.col1
14 , a.col2 = b.col2
15 , a.col3 = b.col3
16 , a.col4 = b.col4
17 when not matched then insert (a.col1) values (null);
3 rows merged.
SQL> select * from t;
COL1 COL2 COL3 COL4 COL5
adsdf fgrty erfth oiunth adsdf,fgrty,erfth,oiunth,okujt
x y x,y
a b c d a,b,c,d
3 rows selected.
SQL> Assuming you're on 9i... -
XML value being turned into math formula.
I am not using E4X, but here is the scenario:
Okay, so I am bringing in a string with a value of 33E-30 for
Train Id. Java is returning the following XML to my flex component:
<train>
<trainId>33E-30</trainId>
<cars>60</cars>
<length>3751</length>
<weight>2712</weight>
<callTime>null</callTime>
<comments>null</comments>
<eta>2007-10-30 05:00:00.0</eta>
<fromRoad>NS</fromRoad>
<toRoad>UP</toRoad>
<interchange>Elkhart (testing)</interchange>
<locationName>Elkhart (testing)</locationName>
<trainType>R5</trainType>
<latitude>41</latitude>
<longitude>-86</longitude>
<splc>362120</splc>
</train>
I then take the value and put it in a Value Object typed as a
String. Flex then displays the following:
3.2999999999999997e-29
It looks like Flex is treating this as some mathematical
formula instead of as a string, even though it is typed as a
string. Any ideas on how to work around this? I am thinking that it
is happening when the xml is being read into the object.I did some more research and the it looks like Flex is making
the change in the ResultEvent processing, or it is showing up as
3.299999... in the source attribute of the response object. Rather
odd.
Is there a way to turn of this attempt at scientific
notation? -
Can I prevent duplicate values entry thru Forms Personalization
We use Oracle Project. While entering key Members on Project Form, we want to prevent users to enter multiple "Project Accountant" within the same project. So essentially there should be only one "Project Accountant" per project. I have sql for this
SELECT 'X'
FROM PA_PROJECT_PLAYERS
WHERE PROJECT_ID = 11494
AND PROJECT_ROLE_TYPE = '1001'
AND ((START_DATE_ACTIVE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, START_DATE_ACTIVE + 1))
OR (END_DATE_ACTIVE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, END_DATE_ACTIVE + 1))
OR (START_DATE_ACTIVE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, START_DATE_ACTIVE + 1)))
AND (PROJECT_PARTY_ID IS NULL OR PROJECT_PARTY_ID != PROJECT_PARTY_ID) ;
But I am not able to figure out how to put this into Forms Personlization. Can someone help.
Thanks
RakeshDeekshitulu,
The seat assignment column in your table - is it part of the Primary Key on the table? If so, you can set the "Enforce Primary Key" property on your data block. More than likely, the seat assignment column is not part of your PK, so you will need to perform a check in your When-Validate-Item trigger on the Seat_Assignment column to check if the seat has already been assign to someone else. This is pretty basic stuff, so I'm guessing you are new to Oracle Forms or this is Classwork. Based on your example, I'd say it is class work, therefore, I'm not going to give you a detailed code sample. I'll just give you the basics and let you provide the details. Here goes...
-- When-Validate-Item
-- Check for duplicate seat assignment
DECLARE
nDummy NUMBER;
BEGIN
BEGIN
SELECT -- some type of count to see if the seat has been assigned already
INTO nDummy
FROM chair_assignments
WHERE seat_number = :my_data_block.seat_number;
EXCEPTION when no_data_found THEN
-- Seat is not assigned. What to do now?
nDummy := 0;
END;
-- Check my Dummy Variable to see if the seat has an assignment record.
IF nDummy > 0 THEN
-- UhOh, my seat is already assigned.
--RAISE and error to stop the form and prevent the double assignment
END IF;
END;If this is not classwork, I apologize for the assumption and would be happy to elaborate on my answer. If this is classwork, please let me know and if you need me to elaborate on my answer - I'd be happy to. We don't mind helping people learn Oracle we just don't want to do your homework/class assignments for you. :-)
Hope this helps.
Craig... -
How to prevent duplicates from being imported?
Apologies if this question has been asked before, but I can't find exactly the answer I'm looking for in the archives.
I want to import an older version of my iPhoto Library into my current iPhoto Library. Since each library contains photos that the other lacks, I want to merge the two; but I can't find any way to tell iPhoto not to import duplicates (there may be 1000's) from the older version of the library to the newer. Can anybody help?First, *do not import one library into another.* You will get as original files all thumbnails, modified photos, faces photo as well as the original photos.
If your newer library is a blank library then all you need to do is open the older library with iPhoto 09 and it will convert it to an iPhoto 09 library. Nothing else needed.
If the new library also has photos and you want to merge the two libraries into one (both must be the same version) use iPhoto Library Manager. This will merge the who libraries into a new 3rd library while keeping all metadata, faces, places, keywords and albums. iPLM can be setup to not import duplicates.
If you just want to import selected Events or albums from one library into the other iPLM can do that also.
Happy New Year -
How can I prevent commas from being entered in the zip code field?
I tried entering the following validation on the Bill To Address field but it did not work. Not sure if it's because the address fields are grouped together.
NOT(InStr([<PrimaryBillToPostalCode>], ',') > 0 AND [<PrimaryBillToCountry>] = 'USA')The Billing and Shipping fields are links to the address records in the adress table. Validation will not work on them. The only avenue that I can find to try to accomplish this would be to have workflow that monitors the address fields and takes action accordingly. That workflow can always set the Country to USA and it could also update the Address field or whatever field you are monitoring for commas.
Good Luck,
Thom -
How to delete duplicate values in a column?
consider a table contains 2 columns(NAME & DEPARTMENT)
NAME DEPARTMENT
santhosh finance
santhosh marketing
rahul sales
stephen IT
stephen sales
In the above table how to delete only the duplicate values(santhosh,stephen) in the column?If you don't care??
delete emp
where 1 < (select row_number() over(partition by deptno order by 1) from emp)
Error at line 1
ORA-01427: single-row subquery returns more than one rowI'd use something like
delete emp e1
where exists
(select null
from (select deptno, rowid rid, row_number () over (partition by deptno order by 1) rn from emp) e2
where e1.rowid = e2.rid
and 1 < rn) -
How to Insert check box value into database column
Hi All,
I had checkbox group in a region which is using an LOV......and having 18 items in that lov.
i.e. Total 18 checkboxes in Total. User has to select only 2 checkboxes from that 18.
I created two columns for storing two values of checkboxes. How to insert two selectives in two columns.........Moreover, How to give the query i.e. how to know which values are selected.
Please Help me in achieving this. apart from the two columns (Focus1,Focus2) .......One more column(l_spo_val) is there which is a foreign key.
My Insert Statement is like this:
INSERT INTO SPO_RESEARCH_FOCUS VALUES(l_spo_val
,:P4_RESEARCH_LIST_1
,:P4_RESEARCH_LIST_2);
Please narrate the code if possible.
Thanks,
Sekhar.Hi Denes,
I saw the example in your workspace and it is the same what exactly i want and instead of storing in one column i want to store the two selected values into two different columns. Also i need to restrict the selection of checkboxes upto 2 only. So If the user tries to select the third check box it doesnt have to accept.
Even I am ready to change my table as according to your example i.e. creating only one column. Store the values of selection into that column.
I was unable to see how u wrote the logic (Code) for your example in your workspace. It helps alot if you provide me the code for that example(Multi Checkbox One Column).
I was facinated after watching your examples in your workspace and am very much interested to know more about Apex.
Please help me insolving this as it is long pending issue for my requirement.
Thanks a lot again,
Sekhar.
Edited by: Sekhar Nooney on Mar 26, 2009 4:35 AM -
How to test if there are duplicate values in a column using PL/SQL
Hello,
I want to be able to test if there are duplicate values (VARCHAR2) in a particular column of the database using PL/SQL.
Thanks
DouglasIf I have understood your requirement, then you are asking for a query like following.
Select column_name from Tbl_name
group by column_name
having count(*) > 1; -
Finding duplicate values in a column with different values in a different c
I'm finding duplicate values in a column of my table:
select ba.CLAIM_NUMBER from bsi_auto_vw ba
group by ba.CLAIM_NUMBER
having count(*) > 1;
How can I modify this query to find duplicate values in that column where I DON'T have duplicate values in a different specific column in that table (the column CLMT_NO in my case can't have duplicates.)?Well, you can use analytics assuming you don't mind full scanning the table.....
select
count(owner) over (partition by object_type),
count(object_type) over (partition by owner)
from all_objects;You just need to intelligently (i didn't here) find your "window" (partition clause) to sort the data over, then make use of that (the analytics would be in a nested SQL and you'd then evaluate it in outside).
Should be applicable if i understand what you're after.
If you post some sample data we can mock up a SQL statement for you (if what i tried to convey wasn't understandable). -
Hi SanjayPradhan,
Based on your formula, I could reproduce this issue in my SharePoint 2013 without any CUs.
Then I created a new column using other types not Date&Time, add the formula =IF(ISBLANK([New Column]),"Employee","ExEmployee"), there is no duplicate values when filtering the calculated column. It seems that this issue only
happens when judging Date&Time column in a calculated column.
I tested in my SharePoint Online, and found I could not reproduce this issue on SharePoint Online.
So, for your issue, please check whether you install any CUs
for your SharePoint 2013. And please install the latest CU for SharePoint 2013.
You can find the latest CU for SharePoint as the link:
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=346
Best Regards,
Wendy
Wendy Li
TechNet Community Support -
Easiest way to identify/delete/prevent duplicate documents
I don't suppose that the text column (e.g. CLOB) is something that I can use the usual trick to delete duplicates with, is it? I would think rather than compare the actual text column, I'd need to calculate a checksum or something for each document and then delete rows with duplicate checksums. Or is there a better way? I'm trying to prevent, for example, a news article getting inserted 10 times because it's a UPI story that was carried by 10 different sites.
Thanks.Your idea of a checksum is a good one. But I'd compute the checksum, and make it a unique constraint, which would PREVENT duplicates from being inserted. It's usually better to prevent them than to clean them up later.
Tom Best
Maybe you are looking for
-
Setting up new dbname/sid while creating oracle db from rman backups in 11g
Hi all, I have rman backups and need to create another database from rman backups with different name... but it is unsuccessful.. created instance with new db... running create new db connecting rman auxiliary sys/password@newdb run { SET NEWNAME FOR
-
Integrate Xcelsius Report in WebDynpro for ABAP
Hi all, I would like to integrate Xcelsius reports into WD for ABAP. This shouldn't be a problem if using EHP1 in ERP backend. But what I would to do is to influence the report's behaviour. E.g. by clicking on a button I want the report to change. Is
-
HT204053 My Macbook doesn't have iCloud under System Preferences. How do I add it?
My MacBook doesn't have iCloud under System Preferences.. Why? How can I add it?
-
PM Order: Plan cost is Zero where as Actual cost is having value
Dear Experts, I wanted to know why Plan cost is comming zero in the Maintenance order, where as Actual cost is having value. Please guide me where it is going wroung Regards
-
Hi I'm trying to setup a Ant script to compile my code, but I keep getting an error regarding an [Embed] Kol: 3: Fejl: '/../assets/images/info.png' kan ikke fortolkes til kodeoverførslen [compc] [compc] [Embed(source="/../assets/ima