check if the fields in the table are duplicated

I neeed to check if the unique table fields are duplicated.

I write this

Select IID_DELOVNO_MESTO, IID_DEL_IN_NALOG from ZKET_DELA_IN_NALOGE_DM Z1
where Z1. IID_DELOVNO_MESTO = (select IID_DEL_IN_NALOG from ZKET_DELA_IN_NALOGE_DM Z2)

but I get

SQL error: ORA-01427: einreihig subquery returns multiple rows
01427 00000 - "einreihig subquery returns several lines.

so I try with loop

declare @stevec int;
declare @izpis chain;

Set @stevec = 1;
While @stevec > 0
Start
Set @izpis = (select IID_DELOVNO_MESTO, IID_DEL_IN_NALOG from ZKET_DELA_IN_NALOGE_DM Z1
where Z1. IID_DELOVNO_MESTO = (select IID_DEL_IN_NALOG from ZKET_DELA_IN_NALOGE_DM I2));
end

impression izpis

and I get

PLS-00103: encountered the symbol "@" when expecting one of the following values:

begin function package pragma procedure subtype type use
< an ID > < a double quote delimited identifier > form
current cursor
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.

and I don't know how to solve this problem.

Published by: senza on Sep 2, 2008 02:08

Published by: senza on Sep 2, 2008 02:17

It will work, but there are probably more effective ways to do so.
Note that the actual query starts from select * from sampledata. The front section is the only reason I can repeat your data

with sampledata
as
(
select 1 ID,12  IID_DELOVNO_MESTO,14 IID_DEL_IN_NALOG from dual union all
select 2, 17, 15 from dual union all
select 3, 12, 14 from dual
)
select * from sampledata
where IID_DELOVNO_MESTO||IID_DEL_IN_NALOG in
(
select cols
from
(
select IID_DELOVNO_MESTO||IID_DEL_IN_NALOG cols,count(IID_DELOVNO_MESTO||IID_DEL_IN_NALOG) from sampledata
group by IID_DELOVNO_MESTO||IID_DEL_IN_NALOG
having count(IID_DELOVNO_MESTO||IID_DEL_IN_NALOG) > 1
)
)

Tags: Database

Similar Questions

  • Check if all the instances of a field in a table are empty?

    I'm having a problem with the control if all instances of a field in a table are empty. If one is empty I need a message box appears. There is a header line and a line of body with several text fields. The line of the body is set to repeat itself and there are buttons to add and remove lines of the body.

    I had success by checking if all fields are blank in the original line by using the following code:

    if ((this.resolveNode("Page1.Table1.Row3.TextField1").rawValue == null | )) this.resolveNode("Page1.Table1.Row3.TextField1").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField2").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField2").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField3").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField3").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField4").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField4").rawValue == ""))

    {xfa.host.messageBox ("Please complete the table of assessment/implementation." )} , 'Incomplete form' , 1);}

    I guess that in all cases be verified that I have to use the 'resolveNodes' function but I could not make it work. That's what I tried:

    if (( == this.resolveNodes("Page1.Table1.Row3.TextField1").rawValue null | )) this.resolveNodes("Page1.Table1.Row3.TextField1").rawValue == "") || .........)

    Although it works not since .rawValue isn't a function that work with resolveNodes (only resolveNode).

    Should what code I use for this?

    Thanks in advance for any advice.

    Hello

    To be able to check each field in a multiple instances of a table line, you must specify which line you are trying to access to...

    To do this, you must specify the index of the row, this way you can treat each rows in a loop and access each field within this line

    Instead of using resolveNodes, I suggest you use resolveNode... and it should look like this:

    for (var i = 0; i)< page1.table1._row3.count;="">

    If (this.resolveNode ("Page1.Table1.Row3 [" + I.ToString + "]").) TextField1.rawValue == null | this.resolveNode ("Page1.Table1.Row3 [" + I.ToString + "]"). TextField2.rawValue | .......) {

    xfa.host.messageBox ("Please complete the table of assessment/implementation.", "incomplete form", 1);

    break;

    }

    }

    I hope this helps!

  • I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?

    Mr President.

    I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?

    formdoubletables.png

    the page source is

    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                    xmlns:f="http://java.sun.com/jsf/core">
      <af:panelFormLayout id="pfl1">
        <af:group id="Group">
          <af:inputText value="#{bindings.VoucherId.inputValue}" label="#{bindings.VoucherId.hints.label}"
                        required="#{bindings.VoucherId.hints.mandatory}" columns="#{bindings.VoucherId.hints.displayWidth}"
                        maximumLength="#{bindings.VoucherId.hints.precision}"
                        shortDesc="#{bindings.VoucherId.hints.tooltip}" id="it1">
            <f:validator binding="#{bindings.VoucherId.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId.format}"/>
          </af:inputText>
          <af:inputDate value="#{bindings.VoucherDate.inputValue}" label="#{bindings.VoucherDate.hints.label}"
                        required="#{bindings.VoucherDate.hints.mandatory}"
                        columns="#{bindings.VoucherDate.hints.displayWidth}"
                        shortDesc="#{bindings.VoucherDate.hints.tooltip}" id="id1">
            <f:validator binding="#{bindings.VoucherDate.validator}"/>
            <af:convertDateTime pattern="#{bindings.VoucherDate.format}"/>
          </af:inputDate>
          <af:inputText value="#{bindings.Credit.inputValue}" label="#{bindings.Credit.hints.label}"
                        required="#{bindings.Credit.hints.mandatory}" columns="#{bindings.Credit.hints.displayWidth}"
                        maximumLength="#{bindings.Credit.hints.precision}" shortDesc="#{bindings.Credit.hints.tooltip}"
                        id="it2">
            <f:validator binding="#{bindings.Credit.validator}"/>
          </af:inputText>
        </af:group>
        <af:group id="g1">
          <af:inputText value="#{bindings.Lineitem.inputValue}" label="#{bindings.Lineitem.hints.label}"
                        required="#{bindings.Lineitem.hints.mandatory}" columns="#{bindings.Lineitem.hints.displayWidth}"
                        maximumLength="#{bindings.Lineitem.hints.precision}" shortDesc="#{bindings.Lineitem.hints.tooltip}"
                        id="it3">
            <f:validator binding="#{bindings.Lineitem.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.Lineitem.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.VoucherId1.inputValue}" label="#{bindings.VoucherId1.hints.label}"
                        required="#{bindings.VoucherId1.hints.mandatory}"
                        columns="#{bindings.VoucherId1.hints.displayWidth}"
                        maximumLength="#{bindings.VoucherId1.hints.precision}"
                        shortDesc="#{bindings.VoucherId1.hints.tooltip}" id="it4">
            <f:validator binding="#{bindings.VoucherId1.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId1.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Debit.inputValue}" label="#{bindings.Debit.hints.label}"
                        required="#{bindings.Debit.hints.mandatory}" columns="#{bindings.Debit.hints.displayWidth}"
                        maximumLength="#{bindings.Debit.hints.precision}" shortDesc="#{bindings.Debit.hints.tooltip}"
                        id="it5">
            <f:validator binding="#{bindings.Debit.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Credit1.inputValue}" label="#{bindings.Credit1.hints.label}"
                        required="#{bindings.Credit1.hints.mandatory}" columns="#{bindings.Credit1.hints.displayWidth}"
                        maximumLength="#{bindings.Credit1.hints.precision}" shortDesc="#{bindings.Credit1.hints.tooltip}"
                        id="it6">
            <f:validator binding="#{bindings.Credit1.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Particulars.inputValue}" label="#{bindings.Particulars.hints.label}"
                        required="#{bindings.Particulars.hints.mandatory}"
                        columns="#{bindings.Particulars.hints.displayWidth}"
                        maximumLength="#{bindings.Particulars.hints.precision}"
                        shortDesc="#{bindings.Particulars.hints.tooltip}" id="it7">
            <f:validator binding="#{bindings.Particulars.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Amount.inputValue}" label="#{bindings.Amount.hints.label}"
                        required="#{bindings.Amount.hints.mandatory}" columns="#{bindings.Amount.hints.displayWidth}"
                        maximumLength="#{bindings.Amount.hints.precision}" shortDesc="#{bindings.Amount.hints.tooltip}"
                        id="it8">
            <f:validator binding="#{bindings.Amount.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.Amount.format}"/>
          </af:inputText>
        </af:group>
        <f:facet name="footer">
          <af:button text="Submit" id="b1"/>
          <af:button actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert"
                     disabled="#{!bindings.CreateInsert.enabled}" id="b2"/>     
          <af:button actionListener="#{bindings.Commit.execute}" text="Commit" disabled="#{!bindings.Commit.enabled}"
                     id="b3"/>
          <af:button actionListener="#{bindings.Rollback.execute}" text="Rollback" disabled="#{!bindings.Rollback.enabled}"
                     immediate="true" id="b4">
            <af:resetActionListener/>
          </af:button>
        </f:facet>
      </af:panelFormLayout>
    </ui:composition>
    
    
    
    

    Concerning

    Go to your VO Wizard, select the tab of the entity and to check if both the EO is editable or not.

    See you soon

    AJ

  • all rows in the table are not eligible for the specified partition

    SQL > Alter Table ABC
    Exchange 2 Partition P1 with Table XYZ;

    Modified table.

    SQL > Alter Table ABC
    Exchange 2 Partition P2 with Table XYZ;


    P2 Partition Exchange with XYZ Table
    *
    ERROR on line 2:
    ORA-14099: all rows in the table are not eligible for the specified partition

    The exchange partition works fine for the first time. However, if we try to swap the 2nd partition it gives the error.
    How to solve this error?
    How can I find the lines which are not qualified for a specific part. is there a query to find out the same thing?

    >
    Well, exchange of syntax and logic is not clearly as it should (IMHO). There is no element of syntax that tells Oracle we want to Exchange partition data in a table that is not partitioned or not partitioned into partition table data.
    >
    What? Not sure where you got that but maybe it was before you had first cup of coffee? ;)

    An "Exchange", it's just that; an Exchange. Partition data end up in the non-partitioned table and vice versa. It is meaningless and totally obsolete if "we want Exchange partition data in a table that is not partitioned or not partitioned into partition table data".
    >
    It was decided by Oracle not partitioned table control. If the non-partitioned table is empty, it means you want to Exchange data partition in a non-partitioned table. And if not partitioned table is not empty, it means you want to Exchange data in the table that is not partitioned into partition.
    >
    There is no decision to make. The segments are swapped. Oracle doesn't check, know or even care if one or the other or both segments are empty. 'Control' which is carried out (by default except if NO CONTROL is used) only consists of ensuring all the data in the segment intended for the partition belongs to this partition.

    It is what gives the example of John. This can NEVER work if table1 is empty unless p1 is empty at the beginning:
    1 Exchange p1 with table1
    2 Exchange p2 with table1

    As John explains, assuming that no other operations are trying to put the data from p1 P2 which is not possible if p1 actually contains data.

    You can save it for next April 1!

  • How to find if the data in the table are distributed on multiple disks

    Hi all

    I have a question on parallel processing.

    Assume that the Oracle (11 g 2) database is installed on a 12 CPU hardware has 24 independent labels, then I guess it's that we can have a maximum of 12 DOP.

    But if the table on which I use the parallel market that spans only 4 discs then the above 4 parallelism will degrade the performance of the query.

    My question is how do I know if the data in the table are spread over the number of disk drives, so that we can properly apply valid parallel operations on the table.

    Appreciate your valuable contributions here.

    Thank you
    MK.

    Just think logically.
    What is a table in the database? A segment.
    What is a segment made up of? Scopes.
    What is recorded on a scale? The id_fichier of the data file.

    ------------
    Sybrand Bakker
    Senior Oracle DBA

  • Adding new partition in the table are

    Hello

    Oracle 9i
    Windows 2003 operating system

    The main entry/exit table is one of the base tables that has a large number of records and a very high success rate, and to avoid poor performance that may occur in such cases, Oracle Table partitioning technique has been examined in the early stages of the implementation of the system.

    Unfortunately, the technique used to divide data based on the year of the transaction considered the year 2010 as the last specific partition, so all records created after this year is gathered in a single partition and this may cause poor performance in the years to come.

    Are required to add another 10 partitions; up to the year 2020 taking into account that the downtime should be close to zero.

    Ground:

    According to my knowledge

    for this, so we can create a new table with the same columns and add required 10 more partitions, and if we take 2 scenarios like

    export/imp
    insertion in the new table select * from < table > old

    What is the best, and if we take exp/imp, if her take a few hours of time to complete a task... what will happen for the updates as insert, update, and delete in this time what will be the impact on the import... I mean if all committed tarnscations... These tarnscations automatically add to the table are not.

    Please tell me what is the best and the tarnscations should not effect... pls tell me how excatly we can complete the task.

    Concerning
    873393

    In my script, I have a DROP TABLE because I'll put up a reproducible demonstration. I can run the script repeatedly and regenerate the same demo data!
    In your environment you would not fall off the table!
    To simplify the demo for you: IGNORE the DROP TABLE command. Pretend it does not exist.

    Hemant K Collette

  • Why all the results are duplicated when searching in my bookmarks library?

    If I search for "Shell", for example, and then click on the 'name' column, most of the 'results' are duplicated. For example, "Perdido | On Shell"in the"shell"folder Parent is shown twice... same URL and al. I see that the or after the 01/02/2013 added bookmarks are NOT duplicated.

    In my case, the bookmarks ARE actually duplicated. I checked by exporting and by analyzing the HTML code.
    The whole "All bookmarks" hierarchy had somehow been copied into a random location of my favorite tree. This is why all bookmarks except most recent lie twice.
    It looked like this:

    - All Bookmarks
      + Bookmarks Toolbar
      + Bookmarks Menu
         + MY_FOLDER_A
         + MY_FOLDER_B
         - MY_FOLDER_C
           MY_NESTED_FOLDER_A
             - All Bookmarks
                .... older state fully duplicated!!!
    

    I deleted the nested copy of "All bookmarks" and it seems OK now.
    I made this copy by mistake (which I highly doubt) or a bug caused.

    Good to hear that you are not using Firefox Sync (I use it). It would have been a Prime Minister candidate for causing a problem like this. (My bad favorites have been replicated to all of the computers connected with synchronization).

    The copy of "All bookmarks" should have been made over the past months, but I couldn't determine exactly when. The copies have the same ADD_DATE and LAST_MODIFIED timestamp in the HTML file.

  • reinstalled itunes on new pc and all the songs are duplicated

    r

    I reinstalled iTunes on new pc and all the songs are duplicated. How can I delete everyone else?

    iTunes can create duplicates if the same content is added several times from outside the media folder when it is about to make copies of everything that is added to the library, or is added from an external drive that hosts the press kit that was disconnected during the launch of iTunes.

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use MAJ > display > show items to reproduce exactly to display the duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning to back up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    TT2

  • How to check where the table field has been used as a foreign key in the database

    Hi I have a field in my table Office I had office_code field, this field has been used in the tables of diffirent as foreign key is a sql I can wirte to see all the tables that have used this field as a foreign key

    Edited by: adf009 09/05/2013 10:37

    Edited by: adf009 09/05/2013 10:38

    Check this box

    SELECT * FROM user_constraints WHERE table_name='EMP' and CONSTRAINT_TYPE='R';
    

    Type = 'R' means referential integrity constraint type.

  • Check if the table contains a value

    Hi all

    I have a table in TestStand that contains numbers. Numbers are generated by a VI and are ranked randomly.

    (1) how can I check to see if the number "6481" is in this table using a step of TestStand?

    (2) is it possible to put this empty table in TestStand, and then complete the table to the size needed when the VI move back the numbers. (i.e. do the table to the size that the VI generates during execution)?

    See you soon,.

    Chase

    I think you will be interested in this Jürgen!

    I managed to do it in 'one step', using a loop.

  • Check if the table is empty

    Hey,.

    I want to make sure that if my MySQL table is empty users would receive "There is no information to display." in their browsers. Here's how I tried to do:

    If (! mysql_query ("SELECT * FROM Table", $con))
    {
    echo "< b > there is no information to display." "< /b > < br / > < br / > ';
    }
    on the other

    {

    echo "< b > we have something to show you. "< /b > < br / > < br / > ';

    }

    Although MySQL table is empty, it returns "We have something to show you." as if there are records in the DB table.

    Do I did wrong? Is there another way to check if the MySQL table is empty?

    * BTW - I use UniServer.

    See you soon,.

    DissidentPJ

    mysql_query only returns false in case of error. An empty recordset is not a mistake. Using a method of number of lines that you mentioned in your second post.

  • Regd select the column in the table area

    Hello

    I have a search page... Have used autocustomization to create... This page will be used to query data from a table and then we must also update two fields of results table and save.

    There is a region of results. I've included the multiselect table option that made me select a column as the first column of the table. Also, including a tableaction and a button upate with whom...

    I need to write a handler for the update now... but do not understand all the slect column...

    Whenever a user clicks on the boxes to select specific records and change the fields and click Update to save, how to write code to check whether the checkbox option has been activated or not?


    Please help me as soon as possible...


    Kind regards
    Preeti

    Hello

    Take a Transient attribute tell 'SelectFlag' in view object and to set the Instance of the view and the view attribute
    for multipleselection in the table.

    Now that the update is click on the button:

    If (PageContext.GetParameter ("Update")! = null)
    {
    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    OAViewObject vo = (OAViewObject) am.findViewObject ("projVO1");
    Line [] row = vo.getAllRowsInRange ();
    Loop through lines
    for (int i = 0; i)<>
    {
    Check if checbox is checked or not
    If (line.getAttribute("SelectFlag").toString().equals("Y"))//means checbox is checked for this line.
    {
    write your logic
    }
    }
    }

    Thank you
    Gerard

  • Values in the table are not default values

    Hi every1,

    I'm working on a VI which relates to the evolution of the points in the chart. Almost, I finished my VI but the thing is that the table of values which

    IAM using here (table Y) do not appear in the value by default when I stop the vi. When I stop and run the vi finally stored values

    Table are defined. One thing is when I click on the stop button is not key to its end. The VI only stops when the stop button goes top

    and then at the bottom. I mean to stop twice the stop button must be clicked. Here's my VI.  Help me to know my mistake here in this

    VI..........

    AAH, I guessed correctly!

    Remove the local var of the button stop & place the terminal itself inside of the while loop inside & it wire directly to the conditional from the outside while loop.

    Please see the attached picture...

  • Rows in the table are break on separate pages...

    I have 20 lines equipped table:

    first 3 lines are on one page, then half of the page is empty hen remaining 17 rows is on the second page.

    How can I keep table to break the lines. I want all rows in the table to succeed himself.

    Help, please. Thank you.

    Keep them with parameters are in the table > Format > Format line...

    Note: the first row on the second page may also have a start parameter that indicates that it is at the top of a page or column.

    The control of widows and orphans just specifies how many rows to keep together (widow is the first page; ( orphan , is the second page) when a table has over a page. The higher the number, the more lines are forced to remain together.

  • Table not found but the data in the Table are available

    Hello

    I connected as SYS.

    When it is placed below query in sql navigator, no line not found.
    Select * from dba_objects where type_objet = 'TABLE' and object_name = 'GREM. "

    But when placed under query, the rows are retrieved.
    Select * from grem.

    How is that possible?

    Hulk says:
    It returns: SYNONYM

    So, you have your answer. Now, you can issue:

    column tbl format a79
    select  nvl2(table_owner,'"' || table_owner || '"."',null) || table_name || nvl2(db_link,'"@' || db_link,'"') tbl
      from  dba_synonyms
      where synonym_name = 'GREM'
    /
    {code}
    
    and see what table synonym points to.
    
    SY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    

Maybe you are looking for

  • Looking for audio driver HP 14 r-017tx

    I download driver for my laptop HP 14 r-017tx, but it is not compatible with my laptop, at the moment im using the default windows driver, so if anyone can help me find my audio driver it would be appreciated

  • stop Subvi nonstop main VI

    Hello I a Vi that has a Subvi within a structure of the event, and this sub - VI runs a measure, and to stop it that I have implemented the code for that ater the measure that ends the program stops, by using the STOP button, which is the same as pre

  • Atrix restarts every 10-20 minutes

    Since the update, I noticed that my Atrix is restarting. Sometimes he will be sitting in my bag for a 3 hour course and I'll take it out, expecting to slide my finger to unlock, but the LED lights in green and I'm inclined to the start screen. In the

  • queue and notifying with state machine

    I'm trying to implement a declarant and a queue to collect data that is running on a state machine in two separate loops.  I'm new to the whole and methods notifier queue and I think I'm really close to make it work as I want.  When I start the compu

  • Error loading C:\WINDOWS\imucabaq.dll

    Error message: RUNDLL Error loading C:\WINDOWS\imucabaq.dll (from the start of the PC) Also: UNPACK200 unavailable for downloading music free, software of "sharing". All patches, easy?  Thank you!  :)