Number of different characters between channels

Hi all

Is it possible to determine the number of characters that differ between the 2 strings in a varchar2 column?
My Table structure is as follows:

CREATE TABLE SPOLIGO_CDC2
(

VARCHAR2 (100 BYTE) MIRU,
FOUND VARCHAR2 (100 BYTE),
FAMILY VARCHAR2 (100 BYTE)
SUBFAMILY OF THE VARCHAR2 (100 BYTE)
COUNTRYLN VARCHAR2 (100 BYTE),

)

My task is given a value of "MIRU", for example. "'2456 c' to determine the row in the table that corresponds to the MIRU which is the closest distance of 2456 ' c ' and the value of this distance. Here the distance is defined as the number of characters that are different, regardless of the value of the characters.

So from the bottom of the values
2456a
23455
3333t

"the closest value to ' 2456 c ' is 'a 2456' and the distance is 1.

Thanks for your help,
Amy

Quick ' n-sale would be a function that takes 2 inputs... the MIRU and target MIRU, compares their character
by character and returns the Distance between the two.

-- I didn't try compiling this, it's just off the top of my head...
CREATE OR REPLACE FUNCTION MIRU_DISTANCE (
  p_val_in SPOLIGO_CDC2.MIRU%TYPE,
  p_ref_in SPOLIGO_CDC2.MIRU%TYPE) return NUMBER
AS
  pos pls_integer;
  l_return number := 0;
BEGIN
  FOR pos in 1..length(p_ref_in)
  LOOP
    IF substr(p_val_in, pos, 1) != substr(p_ref_in, pos, 1) THEN
      l_return := l_return + 1;
    END IF;
  END LOOP;

  IF length(p_val_in) > length(p_ref_in) THEN
    l_return := l_return + (length(p_val_in) - length(p_ref_in));
  END IF;

  RETURN l_return;
END MIRU_DISTANCE;
/

Then you can simply use something like this to do whatever you want with distances.

SELECT MIRU, '2456c' as TARGET_MIRU, MIRU_DISTANCE(MIRU, '2456c') as DISTANCE
FROM SPOLIGO_CDC2

Tags: Database

Similar Questions

  • The key traits appear as different characters in FireFox.

    Before a letter, the number or letter shows a different symbol in Firefox in the address field or field of research. I DataMask by AOL which shows the different characters in his field, but the correct information seems to display in Internet Explorer, for example. I disabled DataMask, but this has not changed the problem with Firefox. I uninstalled Firefox and then downloaded again from your web site, but the problem persists. The only other thing I installed recently is a program called Trusteer Endpoint Protection that has been suggested by and downloaded from my Bank as something to protect my security. As you can see, this message appear correctly while DataMask is showing different letters that I type in Internet Explorer. I couldn't do it in Firefox.

    I don't have Google Chrome or Zone Alarm Spy Blocker Tool bar or toolbar Ask.com installed on Firefox. I just uninstall Trusteer Endpoint Protection and this has solved the problem when I restarted Firefox.

  • Different presentation between the first page and following pages within a section

    Hello

    I met a requirement as follows:

    The report prints some information to order. Each command is a section, including the header and the lines. For a section, there may be several pages (if the number of lines is good enough). It is necessary that, on the first page of each section, it prints all order information in the header of the report and for the next page, it displays only the sequence number in the header of the report.

    It seems necessary different presentation between the first page and the following pages. Has anyone required even like that? Any advice will be useful.

    Thank you
    Clark

    Do you use a for-each@section to get the different sections?

    In this case use "Different first Page" in the "Page layout".

    Published by: amri on July 13, 2010 15:34

  • Problem with the number of lines in the channel

    Dear community LabView,

    I'm relatively new to labview and I came across a problem that (I assume) can easily be resolved with your help.

    I need to create a digital signal to trigger a camera, but I have a problem with the configuration of my lines or exit lanes. I would not use that line output to trigger the camera. (I use a card NI PCIe-6353). LabVIEW is telling me that the number of lines in the channel does not have the number of rows of data:

    Possible reasons:

    Specified read or write operation failed because the number of rows in the data of a string is not the lines in the channel.

    If you use the digital waveform data type, make sure that the number of lines in the digital waveforms is the number of lines in the channel. If you are using Boolean data, make sure that the dimension of the array for the rows of the data is the number of lines in the channel.

    Number of lines in the channel: 1
    Number of data lines: 2

    Task name: _unnamedTask<11>

    How and why the number of data rows is connected to the resolution of my analog digital converter?

    I would appreciate your help! Labview code and a screenshot attached.

    Thank you

    Beff

    I got it to work by changing the "data format" "binary not signed" OR by plugging is not the "offset" for the Square Wave VI.  I think that the default "offset binary" data format works correctly if there is a negative value.

  • I purchased microsoft office 2007 and want to transfer it to a new computer, but I can't find the registration number of 25 characters, can anyone hel locate me in my computer?

    I bought a Dell in 2008 with Microsoft office 2007. The Bill says only an invoice number, but not the registration number of 25 characters. I think it must be in the computer somewhere but I can not find it.

    I did a quick google and found the following site that can help,

    http://pcsupport.about.com/od/productkeysactivation/ht/findof2007key.htm,

    I would try some of the tools which they suggest.

  • Keyboard model 1. 0a 1027 not type correctly, all keys produce different characters

    Original title model keyboard 1. 0 to 1027. Keyboard not typing correctly, all keys produce different characters? Need your help please.

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    1. Ideas:
    • You have problems with programs. ; Wireless keyboard (model 1027), produced different characters when I type, which none match those of l I'm pressing. He is stuck on a different format? I tried to reset the Control Panel, but nothing helped. Need help from someone who knew the problem and the solution please. Thank you

    Error messages

    • Recent changes to your computer
    • What you have already tried to solve the problem

    Hi rvh6636,

    1. you remember to make changes to the computer before this problem?

    2. did you try to use the keyboard on another computer?

    You can try to check the keyboard on the screen and if the problem persists.
    Check out the link:
    Type without using the keyboard (on-screen keyboard)
    http://Windows.Microsoft.com/en-us/Windows-Vista/type-without-using-the-keyboard-on-screen-keyboard

    You can consult the following KB articles and try the steps and check if that helps:

    Troubleshoot wired keyboards that do not or only the erroneous characters category

    http://support.Microsoft.com/kb/258826

    Troubleshoot the incidents of the response to the mouse or wireless keyboard

    http://support.Microsoft.com/kb/838398

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Keyboard produces different characters

    When I try to use the x, s, w, or 2 on the keyboard (on laptop Dell Inspiron 1501), it inserts different characters. When I type the w it inserts... s iuop inserts jkl; ------... inserts, Mr. x------... and 2 inserts 8790. It is done just for these 4 keys n, they are little diagnal online. IDK what the problem is... I have tooken the keys and put them on and I changed the language thing and it still does not. Help, please!

    Try safe mode - does the behavior persist?  What if you try a clean boot?  The techniques in the article of boot is a way to try to identify some software that may be responsible for the behavior.  Also try another user account.

    You have an external keyboard, you can try?

  • BW Images in lightroom CC different 2015 between library and develop modules

    Hello

    I have a strange problem with black and white images with different gamma between library and develop the module.

    Here is a screenshot of the library:

    BW_Library.JPG

    And develop:

    BW_Develop.JPG

    As you can see, very black blacks lost completely all the details in the develop module.

    Anyone have an idea why?

    With sincere friendships.

    Olivier

    When Library and Develop appear differently, it is always due to a broken monitor profile.

    Test title, set monitor to sRGB profile in your computer's operating system.

    See http://www.lightroomqueen.com/articles-page/how-do-i-change-my-monitor-profile-to-check-wh ether-STI-corrupted /

    If this solves the problem, calibrate your monitor with a standard material. (which is something you should do anyway)

  • Output report shows different characters for English letters

    Hello

    The output of the PDF report shows different characters for English letters for alrl concurrent reports

    Could you please put the content of the.env custom file under directory $APPL_TOP?

    Thank you
    Hussein

  • How the control number of the minorticks between two tick marks of the axis?

    Hi guys,.

    I want to draw a number of minor ticks between two graduations of the vertical axis of the column chart based on user input.

    ex: If user provides 2 there are two minor ticks between two tick marks on the axis.

    Thanks in advance.

    From what I can tell with sleeping with her, minorInterval value divides the vertical County to get the appropriate number of ticks between each interval.

    
    
    

    In the example above, I have the interval to 10 and when I put the minorInterval at 2, then I get 5 ticks.  The first tick is the interval and then followed by 4 more ticks.

    In your example, in order for me to see 2 ticks between intervals, then, I must assign the minorInterval 3.5 .

    10 / 3.5 = 3 (2 ticks)

    The forumla should be something like:

    ViewableTicks = interval / (selected ticks + 1);

    So, if I created a drop down list with 1-9 ticks (because 0 does not work if you are showing minor ticks), then when the option is changed, I calculate the value for minor ticks and set the component LinearAxis (countAxis) this new value.

    protected function tickViewList_changeHandler(event:IndexChangeEvent):void
    {
     var tickCount:int = tickViewList.selectedItem;
     var tickView:Number = countAxis.interval / (tickCount + 1);
     countAxis.minorInterval = tickView;
    }
    

    I created a blog post showing my example.

    Post edited by: DeanLoganBH - add link post blog with photos of example

  • How to get the characters between specific characters in a column?

    A column in a table has values like these:
    1/F/E/WS/A. /
    2 F/BV/DFER/E/C/C/V /.
    3 BN/JK/T/E/R/E/QW /.

    How can I get the values this table:
    D
    V
    QW
    These are the characters between the last two /'s.

    You are looking for something like this?

    with yourtable as
    (
    select 'A/F/E/WS/D/' yourcolumn from dual union all
    select 'F/BV/DFER/E/C/C/V/' yourcolumn  from dual union all
    select 'BN/JK/T/E/R/E/QW/' yourcolumn  from dual
    )
    select rtrim(regexp_substr(yourcolumn, '[^/]*/$'),'/')
    from yourtable;
    
  • Tab automatically when you reach the end of a field with the number of limited characters

    Hello!

    Is it possible to activate an automatic tab behavior when the user reaches the end of a field with the number of limited characters?

    I'd like the cursor to move to the next field in tab order automatically.

    Possible?

    Thanks for the tips!

    Marcos

    Hello

    What happens if you tried something like the following example? This works using formCalc on the change event for the user's domain is currently typing in:

    fullCount var = 3
    var currentString = xfa.event.newText
    If (Len (currentString) > = fullCount) then
    xfa.host.setFocus ("TextField2")
    endif

    Or, if you prefer javaScript:

    fullCount var = 3;
    var currentString = xfa.event.newText;
    If (currentString.length > = fullCount) {}
    xfa.host.setFocus ("TextField2");
    }

    These work very well.

    I hope this helps!

    Stephen

  • Limit the Total number of characters between double Quotes using Oracle 11 g PL/SQL

    Hello

    I need a way to apply a limit of 32 substring for each group of data inside double quotes, with Oracle 11 g PL/SQL.

    Essentially using the following example string that much for me, I have no control of how this string is built:

    str := "AAAAAAA BBBBBBB CCCCCCC DDDDDD1","AAAAAAA BBBBBBB CCCCCCC DDDD",”QWERTY”,”N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1”’;

    I need to go through each group of values between each double quote, for example ("QWERTY") and apply a substring of 32 to each group found.

    So, using the example above of the chain, it's as if I need to do the following:

    str := "substr(‘AAAAAAA BBBBBBB CCCCCCC DDDDDD1’,1,32)","substr(‘AAAAAAA BBBBBBB CCCCCCC DDDD’,1,32)",”substr(‘QWERTY’,1,32)”,”substr(‘N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1’,1,32)”’;

    So in the end, my final result for the str would be composed of four groups where the length of each grouping is less than or equal to 32.

    Any help would be great.

    Thank you.

    Try this (replace with your actual table):

    with the temp as

    (

    SELECT substr (REGEXP_SUBSTR (str,'[^,] +', 1, LEVEL) 1, 32) r

    OF THE TEST

    connect IN REGEXP_SUBSTR(str, '[^,]+', 1, LEVEL) IS NOT NULL

    )

    Select replace (listagg (r, '"," ') in the Group (order by null),' ' "','" ' ")

    temp

    output:

    "VIEN BBBBBBB CASTILLO DDDD", "VIEN BBBBBBB CASTILLO DDDDDD1", "N1N1N1N1N1N1N1N1N1N1N1N1N1N1N1N", "QWERTY".

  • Interference between channels using a block of cFP-TC-120, CB-3 connection

    Using a CB-3 with a cFP-TC-120 module connection block for read sensors millivolt. The sensors are pressure with an excitation of 10V sensor. Millivolt signal varies 8mv to-70mv. All have 8 differential channels wired in two of these modules sitting in slots 3 and 4, a slot 4 back on the plain. There is also the 24V in the electrical box used by two modules to relay PSC - 421 driving valves that open, leads at room temperature or in separate the empty rooms they are in slots 1 and 2. Do to the cFP-TC-120 the same and each is affected in the same way, more interference is not only between the same module 120 channels, but also between the modules! If a sensor is vacuum where the millivolt is around 7 mV reading is stable through the following conditional changes. "If a sensor is emptied at room temperature, say channel 6 and channel one is already at room temperature its reading can change by 0.25mv be affected by the evacuation of other channels. This worsens proportional number of channels is ejected by up to 0.5 mV for all other channels that are evacuated. This module is differential and each channel and the module are isolated we don't understand where or how this interference takes place. Help!

    Ben,

    We have done some trouble shooting and isolated in millivolts sensor signal of the NOR. We found that voltage was real and electronics is not the field point. The system runs on 24V except for sensors that have an excitation of 12v. We found that the Commons between these continuous tensions were just that, each have been shared. We have separated the Commons and vola! Perfection.

    Leigh

  • Different behavior between cRIO 'Run as Startup' and debugging run

    Hello

    I have an application that does a lot of things, including playing a card NI 9213 Thermocouple, which lies on a connected to a RT cRIO target expansion chassis. The application is run on the target of RT. My problem is related to a behavioral difference between opening a connection to the channels of thermocouple in debug (by clicking on the arrow on the VI run) mode and the opening of the connection through a Build specification (by clicking Run as to start).

    During execution, the VI wrote in a text file on the hard drive of the cRIO. I enclose the text files, one of the debug mode and a Run as startup mode. I have only two thermocouples connected (ch1 and ch15). From the text file, you can see the connection opens without error in debug mode, but get an error in startup mode. I've also attached an extract showing the VI that I used for the test.

    A few notes:

    Nothing to do with the VI is changed between each type of race.

    The Build specification has the attached VI selected as startup VI, everything else is default

    Someone else out there has had a problem similar to this? I feel like the debug mode should act identically to the normal start deployment. Otherwise, what's the point?

    Thank you

    I solved the problem! Or at least worked around it by setting a different bug. This another bug happened to be the same words that were this bug, to run as a startup. I'll summarize for you:

Maybe you are looking for

  • mix of MultiCam - audio cam and audio desk clip? How?

    I have 3 clips - a cam with audio mediocre, an another cam with fair on audio camera (including public environmental sounds) and good quality audio directly from the desktop. I have create a multicam video and want to then mix the last two audio sour

  • Sizes of icons for Windows 7

    My application is running in Windows 7 Ultimate 64 bit and I use LabWindows/CVI 10.0.1. I created an icon file in the editor of icons included. I kept the size 32 x 32 and 16 x 16 default and added 48 x 48 and 256 x 256, all with 32-bit color version

  • Laptop won't let a connection account. There is no configuration password.

    THE MESSAGE "UNABLE TO LOAD THE USER PROFILE". * original title - OUR PORTABLE LEAVE MY HUSBAND LOG IN TO HIS ACCOUNT. HE DIDN'T THERE WAS NO PASSWORD ON HIS ACCOUNT... ANY ONE OUT THERE GOT ADVICE? *

  • Taskbar autohide function disabled

    I can't hide taskbar. In the taskbar properties, I can't get this to work. I tried to uncheck auto hide and then check again but no use.

  • Unable to activate my anti virus protection on windows Security Center.

    I just installed a new antivirus on my laptop, the avg free anti-virus program, I can see that his work, but I always get a security warning from windows Security Center that my anti virus protection is turned off, and when I choose to turn it on, it