Comparing  NVL strings in IF statement

ORA-06550: line 22, column 12: PLS-00412: list of values not allowed as argument to this function or procedure ORA-06550: line 22, column 1: PL/SQL: Statement ignored
if     nvl((lower(v_address),'null') not like (lower(:ADDRESS)))

Hi,
Lucy Discover wrote:
Whats the valid syntax to compare 2 strings . I want to compare it even if the first string is null.This is the correct syntax
if     nvl (lower (v_address), 'null') not like lower (:ADDRESS)assuming V_adress and and :address are strings (and not some kind of collection, even if made up of strings).
I hope this answers your question.
If not, post a complete procedure or block, a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, so that people can re-create the probnlem and test their ideas. Also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.

Similar Messages

  • Comparing 2 strings in if statement

    Hi All,
    I want to compare two strings in if statement. When I use "==" then its throwing error that expected number and got string. Can anyone please let me know how can we compare two strings in an IF statement?
    Thanks in advance

    The OP doesn't state what release he's on.
    The functions @LIKE and @MBRCOMPARE are 11.1.2 and up only.
    OP, if you're at a lower release, I've faced this problem as well in 11.1.1.3. Here's an older thread that detailed how I got around it for a client:
    Re: How to compare two strings in calc script?
    It really wasn't hard to do and the performance, in the limited context I was using it in, was fine.
    Regards,
    Cameron Lackpour

  • Compare two strings for partial or full match

    I have been trying to figure out away of comparing two strings.
    I can get the full string matching to successfully work but am struggling on how to get partial eg wildcard search working.
    say I had names like paul Duncan, George Morrison.
    I have split them up so its now paul , duncan i then use the users entered string to compare it against the name name to see if it matches anything in the first name or the last name if it does i added it to an arraylist.
    however i have tried t use a indexof as i believe this looks for similarity (Substring matches?) but it always returns -1.
    Could anyone possibly direct me to a method that will allow me to use partial text string to match it against stored user names.
    eg user enters pa
    I would return anything that would contain pa
    thanks for any help

    thank you for the reply
    Sorry I forgot to put in the code.
    This is a reduced down version including the read in from a text file as well as the index of if statement and the adding of it to an array list.
    public class FindContact {
    String res;
    /** Creates a new instance of FindContact */
    public FindContact() {
    public Object[] FindAUser(String passSearch) {
    System.out.println("getting here");
    ArrayList found = new ArrayList();
    String patternStr = ",";
    int j, i = 0;
    try {
    BufferedReader in = new BufferedReader(new FileReader("H:\\out.txt"));
    String str;
    while ((str = in.readLine()) != null) {
    String[] fields = str.split(patternStr);
    //for(j=0;j < fields.length;j++) {
    if (fields.length != 0) {
    if (passSearch.indexOf(fields[0])!=-1 || passSearch.indexOf(fields[1])!=-1) {
    found.add(str);
    System.out.println("ENDDDDDDDD value ");
    in.close();
    } catch (IOException e) {
    System.out.println(e.toString());
    Object[] foundResult = new Object[found.size()];
    foundResult = found.toArray();
    if (foundResult.length >= 0) {
    System.out.println(foundResult.length);
    return foundResult;
    Hope that helps as it has confused me and am not sure why it is not returning a value.
    Should I maybe use the contain method instead to search for the user inputted string?

  • How to Compare two strings in PL/SQL

    Hi All,
    I need to compare two strings whether they are equal or not in PL/SQL.Is there any function to comparing the strings.

    Yes, the = sign.
    Are you after something like:
    IF v_string1 = v_string2 THEN
    ELSE
    END IF;?
    Edited by: Boneist on 27-Aug-2009 11:41

  • Compare two strings in an array

    Hello!
    Please feel free to give me hints, but do not give me any code.
    Ok, here is what I am trying to do, I whant to compare my input string whith strings allready stored in the array. If my input string equals any of the allready excisting strings, a error wil show upp, otherwise store the new string in next avalibal position. I do not seem to get the method right for comparing the strings. here is the method I have written so far, please take a look and give me a hint, but no code. :)
    //Check if a user already excists     
    public void compareNames (People in_array [], String in_name) {
              for (int i=0; i<value.peopleCount; i++) {
                   if (in_name.equals(in_array.getPeople())) {
                   System.out.print("The user already excist, please chose another name");
    }value.peopleCount is an global count value for people arays.
    getPeople get the name from the people class.
    Martin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    A couple notes here.
    The name compareNames() is misleading if it is going to do what you described. A comparison will generally not have side-effects like outputting error messages to the console or adding new items to an array. It would be better if you called the method addIfNew(), and returned a boolean indicating whether the name was new or not. The caller would then be responsible for displaying an error message if the method returned false.
    I also suggest you use a List such as ArrayList instead of an array, otherwise you will have to resize and copy your array every time you add something to it that exceeds the array size, and will allow you to do away with the global peopleCount.

  • Compare two string in different line in textarea

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TextCounterPanel extends JPanel {
    private JTextArea textInput;
    private JLabel lineCountLabel;
                        public TextCounterPanel() {
                        setBackground(Color.DARK_GRAY);
                        textInput = new JTextArea();
                        textInput.setBackground(Color.WHITE);
                        JPanel south = new JPanel();
                        south.setBackground(Color.DARK_GRAY);
                        south.setLayout( new GridLayout(4,1,2,2) );
                             JButton countButton = new JButton("Process the Text");
                             countButton.addActionListener( new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       processInput();
                             south.add(countButton);
                        lineCountLabel = new JLabel(" Number of lines:");
                        lineCountLabel.setBackground(Color.WHITE);
                        lineCountLabel.setForeground(Color.BLUE);
                        lineCountLabel.setOpaque(true);
                        south.add(lineCountLabel);
                        setLayout( new BorderLayout(2,2) );
                        setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
                        JScrollPane scroller = new JScrollPane( textInput );
                        add(scroller, BorderLayout.CENTER);
                        add(south, BorderLayout.SOUTH);
    public void processInput() {
    String text,vin; // The user's input from the text area.
    text = textInput.getText();
    vin =text.substring(25,42);
    lineCountLabel.setText(" vin: " + vin);
    } // end class TextCounterPanel
    How can I compare two string in different line in text area

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TextCounterPanel extends JPanel {
    private JTextArea textInput;
    private JLabel lineCountLabel;
    public TextCounterPanel() {
    setBackground(Color.DARK_GRAY);
    textInput = new JTextArea();
    textInput.setBackground(Color.WHITE);
    JPanel south = new JPanel();
    south.setBackground(Color.DARK_GRAY);
    south.setLayout( new GridLayout(4,1,2,2) );
    JButton countButton = new JButton("Process the Text");
    countButton.addActionListener( new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    processInput();
    south.add(countButton);
    lineCountLabel = new JLabel(" Number of lines:");
    lineCountLabel.setBackground(Color.WHITE);
    lineCountLabel.setForeground(Color.BLUE);
    lineCountLabel.setOpaque(true);
    south.add(lineCountLabel);
    setLayout( new BorderLayout(2,2) );
    setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
    JScrollPane scroller = new JScrollPane( textInput );
    add(scroller, BorderLayout.CENTER);
    add(south, BorderLayout.SOUTH);
    public void processInput() {
    String text,vin; // The user's input from the text area.
    text = textInput.getText();
    vin =text.substring(25,42);
    lineCountLabel.setText(" vin: " + vin);
    } // end class TextCounterPanel

  • Compare two strings in a formula

    Hi,
    I'd like to know if there's a way to compare two strings in a formula ?
    I have this consition:
    IF(@SUBSTRING(@NAME(@CURRMBR(TIME_FROM)),5)==@NAME(@CURRMBR(TIME)))
    But the == operator can only compare two data.
    Thanks,
    Cyril

    Hi,
    thank you both for your answers.
    When I figured that the == operator was for data only, I didn't even try to compare member names.
    I finally used the solution that Cameron suggested in another conversation. I created a date measure, and loaded some data since the beginning of my time to the end.
    It starts in 1974 (annually), then becomes monthly data, and then daily data from 2009, so it's not so many blocks to br created. In the end I have the same value for "from 2008"/"from Apr 30", and I can easily compare my dates.
    Note that I could have also used the @TODATE function, which turns a date into a number, but the format of date is limited and doesn't fit the format of my member names, so I got lasy... and I'm not sure my users would have apreciated that ;)
    Thanks, this post is solved.
    Cyril

  • How to compare German strings with umlaut

    hi
    here is a solution for the problem to compare German strings containing umlaut, which I faced and where I did not find any solution yet!
    The right thing is to use the RuleBasedCollator class and define the additional rules (concerning the umlaut) by yourself and setting the strength of the rule interpretation to PRIMARY!
    Here is the code that works:
    public class UmlautTest { 
    public static void main (String args[]) {    
    String st1 = "Daettenb�ck";
    String st2 = "D�ttenbueck";
    String myRule = "< ae,�,AE,� < oe,�,OE,� < ss,�,SS < ue,�,UE,�";
    RuleBasedCollator myrbCol = null;
    try {
    myrbCol = new RuleBasedCollator(myRule);
    } catch (ParseException e) {
    e.printStackTrace();
    myrbCol.setStrength(Collator.PRIMARY);
    if (myrbCol.compare(st1, st2) != 0) {
    System.out.println("myrbCol: NICHT gleich!");
    } else {
    System.out.println("myrbCol: Gleich!");
    I hope that I could help anyone with that
    nocomm

    The � should be of course replaced by the missing umlaut!
    Sorry, but I didn't preview the topic!
    nocomm

  • Execute an string as select statement

    Hi,
    I have a problem:
    I'm working with an older oracle verion (7.x??). I want to create a dynamic select statement. I create a string, e.g. v_sql_string, and want the database to execute it. What possibilities do I have to do this?
    Thanks in advance
    Mathias

    Yes,
    I went through the documentation, but it's only working with cursors.
    For better comprehension:
    This is the string:
    'select count(*) from invoice where sup_no ' || op_sup_no || ' v_sup_no and trpt_code ' || op_trpt_code || ' v_trpt_code and ship_no ' || op_ship_no || ' v_ship_no'
    I want to set the operators (op_xxx) dynamiclly. Isn't there something like RUN or EXECUTE, where I only have to pass a string, and the statement is executed ...
    But I don't know how ...
    Mathias

  • Compare two strings and the save the greater

    To devolop a vi,it can compare two strings.A string is gived,the other is saved previously.If greater,then save,or do nothing.

    Hi,
    I am assuming by "greater" you mean the string length.
    Use the string length function from the strings palette, with shift-registers on a while loop. Write to the shift-register the "greater" string.
    I am attaching a diagram screenshot for this. NOTE: depending on how you want this VI to run, you can move the input and output string control and indicator inside our outside the while loop.
    Hope this is what you were looking for.
    Khalid
    Attachments:
    strlen.gif ‏17 KB

  • How can u get the matching percentage whenever compare the pdf files(compare the strings)

    Actually I want matching percentage whenever compare the pdf files.First I had completed 
    read the pdf files content into string
    my code like as
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.IO;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using iTextSharp.text.pdf.parser;
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    string str1;
    string filename;
    string path;
    string str2;
    public Form1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    OpenFileDialog openFileDialog = new OpenFileDialog();
    openFileDialog.CheckFileExists = true;
    openFileDialog.AddExtension = true;
    openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
    DialogResult result = openFileDialog.ShowDialog();
    if (result == DialogResult.OK)
    filename = Path.GetFileName(openFileDialog.FileName);
    path = Path.GetDirectoryName(openFileDialog.FileName);
    textBox1.Text = path + "\\" + filename;
    private void button2_Click(object sender, EventArgs e)
    OpenFileDialog openFileDialog = new OpenFileDialog();
    openFileDialog.CheckFileExists = true;
    openFileDialog.AddExtension = true;
    openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
    DialogResult result = openFileDialog.ShowDialog();
    if (result == DialogResult.OK)
    filename = Path.GetFileName(openFileDialog.FileName);
    path = Path.GetDirectoryName(openFileDialog.FileName);
    textBox2.Text = path + "\\" + filename;
    public static string ExtractTextFromPdf(string filename)
    using (PdfReader r = new PdfReader(filename))
    StringBuilder text = new StringBuilder();
    for (int i = 1; i <= r.NumberOfPages; i++)
    text.Append(PdfTextExtractor.GetTextFromPage(r, i));
    string result = text.ToString();
    return result;
    public static string Extract(string filename)
    using (PdfReader r = new PdfReader(filename))
    StringBuilder text = new StringBuilder();
    for (int i = 1; i <= r.NumberOfPages; i++)
    text.Append(PdfTextExtractor.GetTextFromPage(r, i));
    string result1 = text.ToString();
    return result1;
    private void button3_Click(object sender, EventArgs e)
    str1 = Form1.ExtractTextFromPdf(textBox1.Text);
    str2 = Form1.Extract(textBox2.Text);
    }Finally how can u get the matching percentage whenever compare the pdf files(compare the strings)please help me.thank u

    Hi,
    Based on your code, I see your code related to
    iTextSharp Pdf.
    iText is a third party library to create PDF originally written for java. iTextSharp is
    the C# adaptation of that library.
    Question regarding iText are better asked on the iText forum, rather than the Microsoft Forum:
    http://itextpdf.com/support
    Thanks for your understanding.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Comparing 2 strings

    hi
    i have an application, in which, i am taking a string as input from th user(thru a JOptionpane.inputDialog)
    now, i have to compare this string with various other values present in an already stored file.
    please sugest a method to do so.
    the file has different values appended one after another , separated by a space.
    the problem is, i want to parse the entire file, to look for the required value.
    please help.
    thank u.

    Parse the file once using a thread as soon as the program has started running.
    If you just want to know whether or not a value is in the file then just store the values from the file in a Set (java.util.HashSet).
    If you want to associate a value with some other information then store the (key,value) pairs read from the file in a Map (java.util.HashMap).
    If you want to record information about what the user has entered then again store the file informaion in a Map but make the value an object of your own making.

  • How to compare two strings whether both are equal while ignoring the difference in special characters (example: & vs & and many others)?

    I attempted to compare two strings whether they are equal or not. They should return true if both are equal.
    One string is based on Taxonomy's Term (i.e. Term.Name) whereas other string is based on String object.
    The problem is that both strings which seem equal return false instead of true. Both string values have different special characters though their special characters are & and &
    Snapshot of different design & same symbols:
    Is it due to different culture or language?
    How to compare two strings whether both are equal while ignoring the difference in special characters (& vs &)?

    Hi Jerioon,
    If you have a list of possible ambiguous characters the job is going to be easy and if (& vs &) are the only charracters in concern awesome.
    You can use the below solution.
    Before comparing pass the variables through a replace function to standarize the char set.
    $Var = Replace($Var,"&","&")
    This is going to make sure you don't end up with ambiguous characters failing the comparison and all the char are "&" in this case.
    Similar technique is used to ignore Character Cases 'a' vs. 'A'
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Concatination of string to select statement

    hi all,
    pl help me out.
    i want to concatenate string to select statement like
    create or replace procedure my_proc(p_sal number)
    as
    v_name varchar2(20);
    ssql varchar2(4000);
    begin
    ssql := ' ';
    select ssql || ' '|| select emp_name
    into v_name
    from employees
    where sal =p_sal;
    end;
    but it is giving error .
    pl correct it.
    thanks
    pavani

    Pavani,
    Still not clear.
    "Multiple conditions" sounds like you are trying to build predicates in the where clause, but in your example it looks like you are trying to build a select clause. Also your parameter is p_sal so the where clause "sal = p_sal" is fixed.
    The real question is WHY you want to "write multipul conditions"? WHY you want to "store it in a string .and then concatenate the string to next condition so on"?
    Regards,
    Rob.

  • SQL Function to compare 2 strings

    Hi All
    Is there any SQL function to compare 2 strings?

    If you are looking for a character by character comparison then you would have to do something like...
    SQL> ed
    Wrote file afiedt.buf
      1  WITH T AS (select 'THIS IS MY 1ST STRING' string1, 'THIS IS MY 2ND String Bob' string2 from dual)
      2  --
      3  select s1ch, s2ch, decode(s1ch,s2ch,'Match','Mismatch') as compare
      4  from (
      5        select rn, substr(string1,rn,1) as s1ch, substr(string2,rn,1) as s2ch
      6        from t, (select rownum rn from t connect by rownum <= greatest(length(string1), length(string2)))
      7       )
      8* order by rn
    SQL> /
    S S COMPARE
    T T Match
    H H Match
    I I Match
    S S Match
        Match
    I I Match
    S S Match
        Match
    M M Match
    Y Y Match
        Match
    1 2 Mismatch
    S N Mismatch
    T D Mismatch
        Match
    S S Match
    T t Mismatch
    R r Mismatch
    I i Mismatch
    N n Mismatch
    G g Mismatch
        Mismatch
      B Mismatch
      o Mismatch
      b Mismatch
    25 rows selected.
    SQL>

Maybe you are looking for

  • Migo acccounting document

    Dear CONS   The system creates an accounting document while doing T-code- MIGO . which is avaiable DOCUMENT INFO TAB IN fi document.In which table it is available that means account short text as well as value. Account short text         Assignment  

  • Sending Groups Back to their originating OU

    I am setting up to export group changes back to AD. My question is: Without defining an OU in the sync rule will group updates automatically go to the originating OU? Since I have defined the containers to include in the ADMA I would assume this is k

  • Problème de ''package'' dans InDesign

    Quand je tente de faire un package dans InDesign, il ne se termine pas.. il reste gelé à ''Save doc... Ensuite, quand je tente d'ouvrir le doc, la roue tourne sans cesse. Je dois forcer InDesign à quitter et quand j'ouvre à nouveau le programme, mon

  • Help to find a logic

    hi all i m creating a bg job pgm where on selection screen i m inserting date range and i want that for job steps it should break monthly as i m using radiobutton for it as "monthly". means in from ..to range how many months are lying  should be come

  • 100% CPU Utilization on

    I have a 1U Server purchased in August, 2003.  The motherboard model is MS-9129, motherboard chipset is Intel 845E ( Brookdale-E) + ICH4.  Bios is Phoneix Award 6.00 PG, dated 12/10/2002.  We are running Windows 2003 Standard Edition, SP1 The system