Duplicate output

I'm programming in M$ Visual Studio using C++. I used the command "ibrd(...)" to read data from an ancient age spectrum analyzer. :-) My program runs correctly under Windows 95, Pentium MMX (old machine). When I re-compile it under Windows XP, Pentium 4 1.8GHz. Something weird happens. I expect something like "-4.5e1" and it will return "--44..55ee11".
Any idea? Thanks!
-William

Hi,
This is a strange problem. I looked for any known issues or similar situation and all I found was a discussion posting:
"Why do I get some characters twice?"
It does provide some info, but not a definitive solution.
You can try posting this question in the GPIB forum. You are more likely to find someone that has come accross something like this on that forum.
I'll keep looking to see if I find anything.
DiegoF
National Instruments

Similar Messages

  • Duplicate Outputs proposed in Billing Document unexpectedly after 3 months

    We are facing a weird problem in some of our billing documents. After the billing document has been saved and the EDI output ZEDI issued, some days later (or even some months later), 2 or 3 duplicate outputs have been proposed (automatically ?) and the IDOCs also have gone out of the system. But the status of the duplicate outputs remain in "Yellow" status and their Processing Log does not contain the new IDOC #s but the original IDOC # that was sent first.
    We are at a loss to determine root of issue, Users don't remember changing the billing documents at these times but even if they did, the "Multiple Issuing" checkbox is not selected in the Output Type "ZEDI" and hence, outputs should not have been proposed.
    Has anyone faced such an issue before ?
    I have tried to paste some logs below:
    Output Screen:
                  Output     Description Medium     PF     Part#     Language     Proc Date          Proc Time     Date/Tim
    duplicate ZEDI     EDI Invoice     EDI     BP     266     EN                    00:00:00     4
    duplicate ZEDI     EDI Invoice     EDI     BP     266     EN                    00:00:00     4
    duplicate ZEDI     EDI Invoice     EDI     BP     266     EN                    00:00:00     4
    original    ZEDI     EDI Invoice     EDI     BP     266     EN     05/13/2010     00:56:37     4
    When I do a "Determination Analysis" in Output Screen for this faulty billing doc, I get the following..
    Z1EX     502     Output ignored (requirement 962 not fulfilled)
    Z1PA     502     Output ignored (requirement 962 not fulfilled)
    ZCRE     540     Output not found
    ZED2     524     Access not made (initialized field)
    ZEDI     541     Output found
    ZLDO     540     Output not found
    The NAST entries for these outputs are follows:
    Object key     Message type     Message partner     Created on     Created at     Message manually     Processing date     Processing time     Response date     User name     Processing status     Output Device     Spool request name     Suffix 1     Suffix 2     Automatic     Recipient
    92494146     ZEDI     266     5/13/2010     0:56:37          5/13/2010     0:56:37          BATCHADM     1                         X     
    92494146     ZEDI     266     9/9/2010     8:45:26     X          0:00:00          5ECND6     0     AdobePDF     84526     MPDF     20100909     X     5ECND6
    92494146     ZEDI     266     9/9/2010     8:46:09     X          0:00:00          5ECND6     0     AdobePDF     84609     MPDF     20100909     X     5ECND6
    92494146     ZEDI     266     9/9/2010     8:59:20     X          0:00:00          QZL49N     0     AdobePDF     85920     MPDF     20100909     X     QZL49N

    Hi,
    I am getting the same issue. Did you solve this issue? If yes, please share your solution.
    Best Regards,
    Mayank Malpani

  • Prevent Duplicate Output Trigger from Item Level

    Hi,
    We have a requirement of whenever a pricing error happen to send the whole Order information from ECC to an external system through Idocs / Output Trigger.
    The Output for pricing error can be configured by default at the item level. Hence if an ORder has multiple lines that have pricing issues we can get the same Order information sent twice bacuse of output getting triggered more than once.
    Any way I can prevent the duplicate output trigger when multiple items for the same order has issues.
    Regards,
    Arunava

    Hi Arunava,
    You can create a Output Routine using VOFM tcode and attach the routine to your Output type in NACE tcode.
    Inside the routine you can keep check based on the line items / order information.
    Thanks & Regards,
    Ramya.

  • Prevent duplicate outputs within a table?

    Hi at all,
    we have a table in a subform. At the moment there are several lines with the same material. This is ok.
    Is it possible to prevent duplicate output in the form? We want to print out the rest of this line but set the material to blank.
    I tried this with scripting with java script:
    If (data.TF.DATA.field.rawValue == data.TF.DATA[-1].field.rawValue)
         data.TF.DATA.field.rawValue = "";
    Is it possible to point on the previous line with
    DATA[-1]
    This works for the conditional break so I hope this will works too.
    I don`t want to use group levels...
    Thanks.
    Timo

    Thanks for your answer.
    It works.
    data.formular.DATA.field::ready:layout - (FormCalc, client)
    If ($.rawValue == data.form.DATA[-1].field.rawValue) then
         this.presence = "hidden";
    endif

  • Search for records in the event viewer after the last run (not the entire event log), remove duplicate - Output Logon type for a specific OU users

    Hi,
    The following code works perfectly for me and give me a list of users for a specific OU and their respective logon types :-
    $logFile = 'c:\test\test.txt'
    $_myOU = "OU=ABC,dc=contosso,DC=com"
    # LogonType as per technet
    $_logontype = @{
        2 = "Interactive" 
        3 = "Network"
        4 = "Batch"
        5 = "Service"
        7 = "Unlock"
        8 = "NetworkCleartext"
        9 = "NewCredentials"
        10 = "RemoteInteractive"
        11 = "CachedInteractive"
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0""
    or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>" -ComputerName
    "XYZ" | ForEach-Object {
        #TargetUserSid
        $_cur_OU = ([ADSI]"LDAP://<SID=$(($_.Properties[4]).Value.Value)>").distinguishedName
        If ( $_cur_OU -like "*$_myOU" ) {
            $_cur_OU
            #LogonType
            $_logontype[ [int] $_.Properties[8].Value ]
    #Time-created
    $_.TimeCreated
        $_.Properties[18].Value
    } >> $logFile
    I am able to pipe the results to a file however, I would like to convert it to CSV/HTML When i try "convertto-HTML"
    function it converts certain values . Also,
    a) I would like to remove duplicate entries when the script runs only for that execution. 
    b) When the script is run, we may be able to search for records after the last run and not search in the same
    records that we have looked into before.
    PLEASE HELP ! 

    If you just want to look for the new events since the last run, I suggest to record the EventRecordID of the last event you parsed and use it as a reference in your filter. For example:
    <QueryList>
      <Query Id="0" Path="Security">
        <Select Path="Security">*[System[(EventID=4624 and
    EventRecordID>46452302)]]</Select>
        <Suppress Path="Security">*[EventData[Data[@Name="SubjectLogonId"]="0x0" or Data[@Name="TargetDomainName"]="NT AUTHORITY" or Data[@Name="TargetDomainName"]="Window Manager"]]</Suppress>
      </Query>
    </QueryList>
    That's this logic that the Server Manager of Windows Serve 2012 is using to save time, CPU and bandwidth. The problem is how to get that number and provide it to your next run. You can store in a file and read it at the beginning. If not found, you
    can go through the all event list.
    Let's say you store it in a simple text file, ref.txt
    1234
    At the beginning just read it.
    Try {
    $_intMyRef = [int] (Get-Content .\ref.txt)
    Catch {
    Write-Host "The reference EventRecordID cannot be found." -ForegroundColor Red
    $_intMyRef = 0
    This is very lazy check. You can do a proper parsing etc... That's a quick dirty way. If I can read
    it and parse it as an integer, I use it. Else, I just set it to 0 meaning I'll collect all info.
    Then include it in your filter. You Get-WinEvent becomes:
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624 and EventRecordID&gt;$_intMyRef)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0"" or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>"
    At the end of your script, store the last value you got into your ref.txt file. So you can for example get that info in the loop. Like:
    $Result += $LogonRecord
    $_intLastId = $Event.RecordId
    And at the end:
    Write-Output $_intLastId | Out-File .\ref.txt
    Then next time you run it, it is just scanning the delta. Note that I prefer this versus the date filter in case of the machine wasn't active for long or in case of time sync issue which can sometimes mess up with the date based filters.
    If you want to go for a date filtering, do it at the Get-WinEvent level, not in the Where-Object. If the query is local, it doesn't change much. But in remote system, it does the filter on the remote side therefore you're saving time and resources on your
    side. So for example for the last 30 days, and if you want to use the XMLFilter parameter, you can use:
    <QueryList>
    <Query Id="0" Path="Security">
    <Select Path="Security">*[System[TimeCreated[timediff(@SystemTime) &lt;= 2592000000]]]</Select>
    </Query>
    </QueryList>
    Then you can combine it, etc...
    PS, I used the confusing underscores because I like it ;)
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Duplicate output message for invoice

    Hello,
    I'm searching a Bapi or MF to duplicate an output message executed on invoice.
    For exemple:
    on invoice 12345 I create and execute the message RDA0 (for exemple for print).
    Now, by a zprogram I would duplicate this message.
    Any idea ?
    Thank you.

    Hello,
    tks for reply, I run both
    1. RV_MESSAGES_INSERT
    2. RV_MESSAGES_UPDATE
    and the message is created. Anyway, I chose mode 'Archive only', and the archive is not done.
    Do you jnow why ?
    Thank you.

  • Duplicate Output channel strips

    I see a thread about duplicate aux channels appearing. I'm not seeing that on my end, but what I am getting is multiple (and it's more than two now) Output channel strips. Thankfully, they only appear at the concert level, and don't appear more than once in each patch or set. But the behavior is really bizzare, and a little worrisome because i've found that if I try to delete one of them, if I can successfully do it, then the file will become corrupted and will never reopen! When I'm at the concert level, if I adjust any of the controls on one of them, it's adjusted for all of them... very strange indeed.
    I've created multiple Concert files, and I see this behavior exhibited in all of them. The more patches I add, the more the number seems to grow. I believe that every time I copy/paste a patch, it adds one, but I'm not sure exactly what the exact criteria are to make this happen. Is anyone else seeing this?
    Also, I have two unrelated questions:
    1) There isn't, by any chance, a way of creating alias or shortcut patches, is there? Some way of creating duplicates so I can create multiple sets with some of the same patches (I'd like to create some "Show Setlist" sets, and a main "All Tracks" set, but have some of the same patches in each, that would get modified when I modify any instance).
    2) I'm coming from Jambalaya, a similar, and simpler live host that I would continue to be using today if the developer continued supporting it. One thing that was really nice about that was it had a virtual rack where you could store common instruments and effects. It would be accessible to all "songs" (patches), and would save a major amount of load time. Since every one of my patches contains from 2 - 8 instrument channels, it was really helpful. I don't suppose there is any way to reproduce this functionality in MS? I also use this feature in Digital Performer, but I don't use that as a live host. So far, I've noticed that if you add a channel strip at the concert level, it plays back on all patches without any routing or way of arming it or not, so that won't work for me. I guess this is more a feature request than a question, but I'm new enough to MS that maybe someone has found a way.

    I haven't experienced any of the channel strip issues, at the concert level or at patch level. It's easy to copy patches or make aliases. To copy a patch, select a patch, go to edit>copy or command>C. To paste, edit>paste or paste as alias(command>V or option-command>V).

  • Ifconfig -a output shows duplicate output

    Hi,
    When I run the ifconfig -a command on the solaris 10 virtual machine I get an output which contains the below entry
    <BROADCAST, RUNNING,MULTICAST,IPv4, DUPLICATE>
    Also, I could find the following entry in /var/adm/messages file
    Apr 9 20:06:59 penguin ip: [ID 567813 kern.warning] WARNING: e1000g0 has duplicate address 192.168.210.034 (in use by 00:00:66:61:6b:65) ; disabled
    Apr 9 20:06:59 penguin in.routed[471]: [ID 238047 daemon.warning] interface e1000g0 to 192.168.210.34 turned off
    the output of arp -a only shows the following
    e1000g0 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00
    I have waited for a few hrs now for this issue of the duplicate IP address to get resolved automatically but it still perists.
    Actually this IP address was working perfect till yesterday .
    Today I copied my vm to a different machine and then started it . Thats when all the problem started.
    The ifconfig output always give the DUPLICATE message .
    How do I rectify this problem
    Thanks In Advance,
    Suresh

    You need to get whatever is responding to that address to stop It's not that easy. Detecting of asumed duplicate IPs has become more "sensitive" with a late Solaris 10 release (or patch). These installations of Solaris even detects running IPs in other broadcast domains. In former Solaris 10 releases this was not a problem, i could define interfaces of several systems with the same (virtual) IP, as long as these systems did not act as a gateway. This has changed and is not possible anymore. We had to redefine IPs in our network for that reason...

  • Issue with Duplicate Results and Summary Fields

    My report is based on an Access Database. For the purposes of this current issue, there is the Master Table called u201CCnu201D and then a related u201CTable Au201D which includes multiple records related to the Master and also a related u201CTable B,u201D also with multiple records related to the Master.
    For my report, I want to output results from Table B based on criteria in Table A. This naturally produces duplicate output on the report. As a result, the Summary Fields that I want to include are incorrect.
    I have tried multiple combinations of the Select Distinct function, suppression based on u201Cprevious fieldu201D being equal, summary fields, running totals and if-then statements and still cannot find a solution that works in all of the cases involved.
    Below are descriptions of three different scenarios that are occurring:
    EXAMPLE #1: Entry 1 has 2 records in Table A and 2 Records in Table B so "Select Distinct" including the Table B ID # and then a Summary Field for the Total produces the correct results, while a Running Total is Incorrect.
    EXAMPLE #2: Entry 2 has 2 records in Table A and 1 Record in Table B so a suppression formula of the field based on the "Previous =" Table B ID # and the Running Total produce the correct results, while Summary Field is incorrect.
    EXAMPLE #3: Entry 3 has 6 records in Table A and 6 Records in Table B. Neither Summary or
    Running Totals produce correct results.
    I would greatly appreciate any advice in terms of creative formulas, etc. that would help produce correct results here.
    Iu2019ll be pulling my hair out soon! Thanks so much-

    Hi Berry
    Try to create a command with a subquery. The subquery will be returning the the duplicate records and the main query that uses this subquery will find distinct records out of the resultset returned by the subquery.
    Let me know if this helps.
    Regards
    Nikhil

  • Audigy 2 ZS Output Sound bleeding into input(m

    Hi,
    I'm having trouble with the Audigy 2 ZS in Windows x64 with
    SBA2_WEB64_LB_2_03_0004.exe &
    AudCon_PCApp_LB__20_23.exe
    installed.
    The problem is when sound is being send to the Audigy output port (head phones) it's also being sent to my mic (input port). I can physically disconnect the mic from the Audigy 2 ZS card and I still get a duplicate output into the input port. Even if I mute the mic in the sound control panel.
    Example, If I play a MP3 in winamp and start recording using Windows sound recorder, it will record the output prefectly without anything connected to the back of the card.
    The real issue is the feedback people are getting when trying to talk to me using Vent or Teamspeak. Anything they say, it echos right back to them.
    CMSS on or off doesn't make a difference.
    If anyone has any ideas, I'd like to hear them? I'm thinking it might be a bad card but didn't want to send it back until I tried everything.
    -Wojek

    The problem was with the Sound recording device being "select"ed on the Wave instead of the Microphone. Even though the Microphone was working, it was still also sending the output or the Wave along with it.
    -Wojek

  • Unico Drive serial interface error

    1) I am trying to talk to a Unico drive via a serial port. I receive a -1073807339 error in the Vesa Read in the Drive Send VI. However, the VISA write doesn't seem to be getting to the drive properly as it should effect the speed even though the read doesn't work. I have been able to talk to the drive in HTBasic. I checked that the port settings are correct. I checked the CRC creation. The command is to be sent without any character trailing the CRC character. I turned that off in the VISA open. Any suggestions what else to try?
    2) I also found that the VISA duplicate output doesn't work in the VISA open. That block element outputs an empty VESA device addr when "probed". Any idea why that isn't working?
    Attachments:
    Drive.llb ‏202 KB

    RicK,
    The error -1073807339 is almost always caused by a timeout. Adding a wait function, running in Highlight execution mode, or running with Ni-Spy will slow the processor and give the instrument time to read and generate a response. For more information, check out our VISA support page at: http://www.ni.com/support/visasupp.htm
    Sarah Fenney
    Applications Engineer
    National Instruments

  • Result set looping and arrays??????????

    Hey i have a result set problem in using an applet connected to a database.
    After i have accessed a database, i am using a result set to store these values, then put them into arrays to out put to screen. im using:
    count = 0;
    while(rs.next())
    lecturer[count] = rs.getString("FirstName") + " " + rs.getString("Surname");
    room[count] = rs.getString("Room_No");
    sentence = rs.getString("Subjects");
    if(sentence.length()>12)
    space = sentence.indexOf(" ");
    subject[count] = sentence.substring(0,(space));
    subject2[count] = sentence.substring((space+1),sentence.length());
    else
    subject[count] = sentence;
    subject2[count] = " ";
    timeslot[count] = rs.getInt("Time_slot");
    count++;
    resCount++;
    rs.close();
    stm.close();
    The while is there untill there are no more values in the result set. This should work(in theory). But for some reason the while loop goes around and around until 'size' (which is the size for all the arrays) is reached. This is a set value at the start of the applet. But whenever i change it the while loop goes around that many times without fail. this results in duplicate outputs to screen, that i dont want.
    Anyone got any ideas????????????

    This flow doesn't make too much sense to me. Why are you setting an absolute limit on the length of the array, if it should really be determined by the number of rows in your resultset. It sounds like you would be better off using a Collection class, like:
    List names = new ArrayList();
    while(rs.next()) {
      names.add(rs.getString("name"));
    }

  • Ojdbc14_g.jar and tracing

    I have been trying to get tracing to work for the last couple of days. I have read all of the docs about tracing but I am still missing something. I am hoping that someone can fill in the gaps for me.
    In my code JSP code I have the following:
    System.setProperty("java.util.logging.config.file", "/pirusfj/OracleLog.properties");
    oracle.jdbc.driver.OracleLog.setTrace(true);
    System.out.println ("Tracing turned on");
    Where in my web directories should the OracleLog.properties file be so that it is picked up by the logger? Do I need to have OracleHome set to that location? Also I have everything set to FINEST. Should the log out put come out as INFO: log message or FINEST: log message?
    The OracleLog.properties file is the one that came with the demo code and everything is changed from INFO to FINEST. Here is a copy of it:
    # OracleLog.properties Copyright Oracle 2004
    # Controls output of OracleLog for JDBC applications using
    # JDK1.4.x and ojdbc14_g.jar
    # See the Javadoc for OracleLog for more information.
    # Starting with Oracle 10gR1 the OracleLog system in
    # ojdbc14_g.jar for JDK1.4.x uses the services of
    # java.util.logging.* This file is a starting
    # point for controlling that output via a properties
    # file. Note that there is also a programatic interface
    # for java.util.logging which may be used as well. That
    # would allow finer grained control and the ability to
    # change the logging as the program runs.
    # Copy this file to your runtime directory to use as a
    # starting point. You should expect to change it to
    # suit your needs.
    # To enable logging controlled by this file start your
    # main java class with the swtiches
    # -Doracle.jdbc.Trace=true
    # -Djava.util.logging.config.file=OracleLog.properties
    # See also the file logging.properties in the jre/lib directory
    # in your JDK1.4 installation and the JDK documentation.
    handlers= java.util.logging.ConsoleHandler
    .level= FINEST
    # default file output is in user's home directory.
    java.util.logging.FileHandler.pattern = jdbc.log
    java.util.logging.FileHandler.limit = 50000
    java.util.logging.FileHandler.count = 1
    java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
    # Setting this to SEVERE avoids duplicate output from default logger
    java.util.logging.ConsoleHandler.level = FINEST
    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    # Starting point -- main driver function level log
    oracle.jdbc.level = FINEST
    oracle.jdbc.driver.level = FINEST
    # Uncomment and/or change the levels for more detail
    oracle.jdbc.datum.level = FINEST
    oracle.jdbc.adt.level = FINEST
    oracle.jdbc.conversion.level = FINEST
    oracle.jdbc.adt.level = FINEST
    oracle.jdbc.thin.level = FINEST
    oracle.jdbc.datum.level = FINEST
    oracle.jdbc.kprb.level = FINEST
    oracle.jdbc.pool.level = FINEST
    oracle.jdbc.xa.level = FINEST
    oracle.jdbc.sqlj.level = FINEST
    oracle.jdbc.oci.level = FINEST
    oracle.jdbc.jpub.level = FINEST
    # Category definitions are listed in the following:
    # USER_OPER JDBC API level tracing.
    # INFO (expected volume: low)
    # PROG_ERR Program error (eg. an unexpected value encountered
    # SEVERE in a switch statement). Messages of this category
    # is not maskable.
    # (expected volume: low)
    # ERROR Error conditions that usually lead to catastrophic
    # SEVERE or unrecoverable results. Messages of this
    # category is not maskable.
    # (expected volume: low)
    # WARNING Error conditions that are usually recoverable.
    # WARNING Note that the module and sub-module filters do not
    # apply to messages of this category. See also
    # enableWarning().
    # (expected volume: low)
    # FUNCTION Function entry/return information.
    # FINE (expected volume: medium)
    # DEBUG1 High-level debug information.
    # FINER (expected volume: medium)
    # DEBUG2 Detail debug information.
    # FINEST (expected volume: high)
    # SQL_STR SQL string
    # CONFIG (expected volume: low)
    Any help would be greatly appreciated.
    Thanks,
    Susan Conger

    Duplicate post:
    ojdbc14_g.jar and tracing
    Susan,
    You wrote:
    In my JSP code I have the following:
    System.setProperty("java.util.logging.config.file", "/pirusfj/OracleLog.properties");For some "System" properties, the "setProperty()" method does nothing.
    These properties must be set on the command-line using the "-D" option of the "java" command.
    Indeed, this is stated in the comments of the demo code that you posted, namely:
    # -Djava.util.logging.config.file=OracleLog.propertiesYou also asked:
    Where in my web directories should the OracleLog.properties file beThat may depend on the JSP engine you are using.
    Excuse me, but I couldn't find that information in your post.
    Hence I can't really answer that question.
    Good Luck,
    Avi.

  • SQL O/P 3 Vs 6

    create table t_look as
    select 1 a, 2 b, 3 c from dual union all
    select 1 a, 20 b, 3 c from dual union all
    select 1 a, 21 b, 3 c from dual union all
    select 1 a, 22 b, 3 c from dual union all
    select 1 a, 23 b, 3 c from dual union all
    select 1 a, 24 b, 3 c from dual union all
    select 1 a, 25 b, 3 c from dual union all
    select 1 a, 26 b, 30 c from dual union all
    select 1 a, 26 b, 30 c from dual;
    Why the output is different in below two sqls , pls help me in understanding to know why oracle makes UNION of records in first sql below and UNION ALL in 2nd sql?
    SELECT
      FROM t_look o1
    WHERE     o1.b IN (20, 26)
           AND (   o1.a IN (SELECT a
                              FROM t_look
                             WHERE b = 20)
                OR o1.c IN (SELECT c
                               FROM t_look
                              WHERE b = 26))
    1     20     3
    1     26     30
    1     26     30
    SELECT
    o1.*
          FROM t_look   o1,
           (SELECT a
              FROM t_look
             WHERE b = 20 ) o2,
           (SELECT c
              FROM t_look
             WHERE b = 26  ) o3
    WHERE o1.b IN (20,26) AND
    ( (o1.a = o2.a) OR (o1.c = o3.c))
    1     20     3
    1     26     30
    1     26     30
    1     20     3
    1     26     30
    1     26     30
    Also Hw to get 3 records output in 2nd sql which will be equivalent to first sql.

    Hi,
    900221 wrote:
    create table t_look as
    select 1 a, 2 b, 3 c from dual union all
    select 1 a, 20 b, 3 c from dual union all
    select 1 a, 21 b, 3 c from dual union all
    select 1 a, 22 b, 3 c from dual union all
    select 1 a, 23 b, 3 c from dual union all
    select 1 a, 24 b, 3 c from dual union all
    select 1 a, 25 b, 3 c from dual union all
    select 1 a, 26 b, 30 c from dual union all
    select 1 a, 26 b, 30 c from dual;
    Thanks for posting the sample data in a useful form; that really helps!
    Why the output is different in below two sqls , pls help me in understanding to know why oracle makes UNION of records in first sql below and UNION ALL in 2nd sql?I don't know if comparing either of these queries to UNION or UNION ALL is enlightening. The difference between UNION and UNION ALL is exactly the same as the difference between SELECT and SELECT DISTINCT, but neither of these queries has anything to do with DISTINCT. With the given sample data, both produce duplicate output rows.
    SELECT
    FROM t_look o1
    WHERE     o1.b IN (20, 26)
    AND (   o1.a IN (SELECT a
    FROM t_look
    WHERE b = 20)
    OR o1.c IN (SELECT c
    FROM t_look
    WHERE b = 26))
    1     20     3
    1     26     30
    1     26     30Let's call the query above Query 1.
    Query 1 is basically a query on one table:
    SELECT  *
    FROM    t_look
    WHERE   ...;Since there are 9 rows in the t_look table, there will be between 0 and 9 rows in the result set, no matter what's in the table, or what's in the WHERE clause.
    Let's call the query bleow Query 2:
    SELECT
    o1.*
    FROM t_look   o1,
    (SELECT a
    FROM t_look
    WHERE b = 20 ) o2,
    (SELECT c
    FROM t_look
    WHERE b = 26  ) o3
    WHERE o1.b IN (20,26) AND
    ( (o1.a = o2.a) OR (o1.c = o3.c))
    1     20     3
    1     26     30
    1     26     30
    1     20     3
    1     26     30
    1     26     30Query 2 is a join of 3 "tables": t_look, o2 and o3.
    SELECT  ...
    FROM    t_look
    ,       o2
    ,       o3
    WHERE   ...(Of course, o2 and o3 are based on t_look, but that doesn't really matter.) Depending on the data and the conditions, there could be as many as 9 rows in each "table", and they could match each of the rows in the other tables, so you could conceivably have 9 * 9 * 9 = 729 rows in the result set.
    Also Hw to get 3 records output in 2nd sql which will be equivalent to first sql.Sorry, I'm not sure what you're getting at here.
    With the same sample data, Query 2 will always produced the same 6 rows. If you make any changes to it, no matter how slight, then it will not be Query 2 any more.
    If you want the same results as Query 1, why not use Query 1?
    If you're looking for other ways to get the same results as Qeury 1, here's one:
    SELECT     *
    FROM     t_look
    WHERE     (b = 20  AND  a IS NOT NULL)
    OR     (b = 26  AND  c IS NOT NULL)
    ;This will probably be more efficient than Query 1, because it only makes one pass through the table, with no sub-queries.

  • Regexp_replace and regexp_substr questions

    Hello,
    I am new to regular expressions. Need help with following :
    1. Need to remove duplicate alphanumeric string followed by space character.
    Input : 'SAY HELLO HELLO HELLO WORLD'
    Output: 'SAY HELLO WORLD'
    Input : 'MY STRING STRING HAS DUPLICATES'
    Output: 'MY STRING HAS DUPLICATES'
    2. Parsing.
    Input1 : 'APT D67 1023 MAIN ST BUFFALO NY'
    or
    Input2 : '1023 MAIN ST APT D67 BUFFALO NY'
    Extract the following: 'APT D67 '
    Output: '1023 MAIN ST BUFFALO NY' , 'APT D67'
    How to extract substr using regexp? 'D67' is alphanumeric value might neccesserely appear after APT. Regexp_instr?
    3. Is it solution to use regexpr to eliminate duplicates in the following case ?
    Input : _'APT 789_ 456 FLOWER DR APT 789 VALEJIA CA'
    Output: 'APT 789 456 FLOWER DR VALEJIA CA'
    Thanks in advance.

    REgards salim.
    WITH T AS
         (SELECT  'SAY HELLO HELLO HELLO WORLD'     TXT
                FROM DUAL
        UNION ALL
         SELECT 'APT 789 456 FLOWER DR APT 789 VALEJIA CA'
               FROM DUAL
          UNION ALL
          SELECT      'MY STRING STRING HAS DUPLICATES'
          FROM DUAL
        SELECT TXT|| case when apt is not null then ' ,'|| APT end    txt
      FROM (
             SELECT   distinct  RN,TXT ,rang,apt
             FROM   T
            MODEL
              RETURN UPDATED ROWS
               PARTITION BY ( ROWNUM RN)
               DIMENSION BY (0 POSITION)
             MEASURES     (TXT ,NVL(LENGTH(REGEXP_REPLACE(TXT,'[^ ]+','')),0)+1 NB_MOT, 0 rang,
             REGEXP_SUBSTR(TXT,'^APT [0-9]+') apt)
              RULES
              (TXT[FOR POSITION FROM  1 TO NB_MOT[0] INCREMENT 1]  =
               REGEXP_SUBSTR(TXT[0],'[^ ]+',1,CV(POSITION)) ,
               APT[FOR POSITION FROM  1 TO NB_MOT[0] INCREMENT 1]  =
               REGEXP_SUBSTR(TXT[0],'^APT [0-9]+'),
                rang[position>=1]=  instr(txt[0],txt[cv()],1)) )
      MODEL
      RETURN UPDATED ROWS
    PARTITION BY (  RN,APT )
      DIMENSION BY ( ROW_NUMBER() OVER (PARTITION BY RN ORDER BY rang ASC) AS POSITION)
      MEASURES ( CAST( TXT AS VARCHAR2(1000) ) AS TXT  )
       RULES
      UPSERT
      ITERATE( 1000)
    UNTIL ( PRESENTV(TXT[ITERATION_NUMBER+2],1,0) = 0 )
      (TXT[0] = TXT[0] ||   CASE WHEN ITERATION_NUMBER+1=1 AND TXT[ITERATION_NUMBER+1]='APT' THEN NULL
                             WHEN ITERATION_NUMBER+1=2 AND TXT[ITERATION_NUMBER]  ='APT' THEN NULL
                              ELSE   ' ' || TXT[ITERATION_NUMBER+1] END )
       ORDER BY rn
    SQL> WITH T AS
      2       (SELECT  'SAY HELLO HELLO HELLO WORLD'     TXT
      3              FROM DUAL
      4      UNION ALL
      5       SELECT 'APT 789 456 FLOWER DR APT 789 VALEJIA CA' 
      6             FROM DUAL
      7        UNION ALL
      8        SELECT      'MY STRING STRING HAS DUPLICATES'
      9        FROM DUAL
    10     )
    11      SELECT TXT|| case when apt is not null then ' ,'|| APT end    txt
    12    FROM (
    13           SELECT   distinct  RN,TXT ,rang,apt
    14           FROM   T
    15          MODEL
    16            RETURN UPDATED ROWS
    17             PARTITION BY ( ROWNUM RN)
    18             DIMENSION BY (0 POSITION)
    19           MEASURES     (TXT ,NVL(LENGTH(REGEXP_REPLACE(TXT,'[^ ]+','')),0)+1 NB_MOT, 0 rang,   
    20           REGEXP_SUBSTR(TXT,'^APT [0-9]+') apt)
    21            RULES
    22            (TXT[FOR POSITION FROM  1 TO NB_MOT[0] INCREMENT 1]  =
    23             REGEXP_SUBSTR(TXT[0],'[^ ]+',1,CV(POSITION)) ,
    24             APT[FOR POSITION FROM  1 TO NB_MOT[0] INCREMENT 1]  =
    25             REGEXP_SUBSTR(TXT[0],'^APT [0-9]+'),
    26              rang[position>=1]=  instr(txt[0],txt[cv()],1)) )
    27    MODEL
    28    RETURN UPDATED ROWS
    29   PARTITION BY (  RN,APT )
    30    DIMENSION BY ( ROW_NUMBER() OVER (PARTITION BY RN ORDER BY rang ASC) AS POSITION)
    31    MEASURES ( CAST( TXT AS VARCHAR2(1000) ) AS TXT  )
    32     RULES
    33    UPSERT
    34    ITERATE( 1000)
    35   UNTIL ( PRESENTV(TXT[ITERATION_NUMBER+2],1,0) = 0 )
    36    (TXT[0] = TXT[0] ||   CASE WHEN ITERATION_NUMBER+1=1 AND TXT[ITERATION_NUMBER+1]='APT' THEN N
    ULL
    37                           WHEN ITERATION_NUMBER+1=2 AND TXT[ITERATION_NUMBER]  ='APT' THEN NULL
    38                            ELSE   ' ' || TXT[ITERATION_NUMBER+1] END )
    39     ORDER BY rn
    40  /
    TXT
    SAY HELLO WORLD
    456 FLOWER DR VALEJIA CA ,APT 789
    MY STRING HAS DUPLICATES
    SQL>  Edited by: Salim Chelabi on 2009-04-06 14:05
    Edited by: Salim Chelabi on Apr 6, 2009 4:11 PM

Maybe you are looking for

  • Installation Error (15)

    Hi everybody! I have a problem installing adobe edge animate cc. My Laptop runs a Win7 Premium SP1 and fulfills all other system requirements. When i try to install the creative cloud desktop app i get the adobe application manager which i hope is st

  • ADF BC----- Iterator issue

    i create a new employee using a creation form and the ID is saved inside a DBSequence variable so i want to use the variable in a couple pages further it seems like the iterator loses its memory value it works perfectly for the page immediatly follow

  • How can I detect if a customers browser supports Java?

    I have numerious websites using a Java e-commerce program called U-Shop. I have customers that do not have Java enabled or installed that cannot see the Java Applets on the site and leave the site because they don't think they can shop-on line. Most

  • Mail not picking up from Yahoo

    My wife has an email account from Yahoo. Over the last few days she has been having a problem picking up email from the account. She has an and older eMac (CRT) that is still running OS 10.4 (Tiger) and using Mail for email. We have a DSL service fro

  • Final cut pro fcp 6.0.6 unexpected quit using OS 10.6.8

    Just upgraded to OS 10.6.8 and installed MacKeeper (big mistake) and FCP 6.0.8 quits during start up?  Trashed MacKeeper and re-installed everything but Final Cut Pro still quits during start up?  Everything else seems fine - any sugegstions about wh